Few recent dmd pull requests

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 27 13:02:36 PDT 2014


On Thursday, 26 June 2014 at 10:38:54 UTC, bearophile wrot
> https://github.com/D-Programming-Language/dmd/pull/3615
>
> Will allow very handy, more DRY and less bug-prone like this:
>
> // static array type
> int[$]   a1 = [1,2];    // int[2]
> auto[$]  a2 = [3,4,5];  // int[3]
> const[$] a3 = [6,7,8];  // const(int[3])
>
> A comment by Walter:
>
>>My reservation on this is I keep thinking there must be a 
>>better way than [$].<

It can share syntax with explicit array operations:
int[*] a1 = [1,2]; // int[2]
int[*] a2 = [3,4]; // int[2]
a1[*] = a2[*]; // copy a2 to a1


More information about the Digitalmars-d mailing list