Re: [RFC] Convert builin-mailinfo.c to use The Better String Library.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Walter Bright <boost@xxxxxxxxxxxxxxx> writes:

>  void foo(int array[10])
>  {
>     for (int i = 0; i < 10; i++)
>     {   int value = array[i];
>         ... do something ...
>     }
>  }
>
> to:
>
>  void foo(int[] array)
>  {
>    foreach (value; array)
>    {
>      ... do something ...
>    }
>  }
>
> takes a lot of frankly unnecessary things away, each of which is a
> potential source of error when maintaining the code.

The problem is a toy problem: in real applications, you'll need to
access several data structures using the same index, and you'll need
to be able to assign index values to temporary variables and so on.
So being able to hide the type of an index in one very specific
application (looping through a single array completely) at one place
is not going to buy you much.

Anyway, D is pretty much irrelevant as a perspective for git, so you
should take it to a language advocacy group.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux