Alternate signs in a range

Stanislav Blinov stanislav.blinov at gmail.com
Sun Jan 26 06:17:30 PST 2014


On Sunday, 26 January 2014 at 13:49:34 UTC, bearophile wrote:
> Stanislav Blinov:

>> We need generic enumerate() in Phobos :(
>
> It will come soon :-)
> https://github.com/D-Programming-Language/phobos/pull/1866

Cool!

>
> This also shows we need a good syntax to unpack tuples:

100% agree.

>
> myRange.enumerate.map!(t{i, x} => i % 2 ? -x : x);

Why not just like ((i, x) => i % 2 ? -x : x)? Isn't (a,b,...) how 
an unpacked tuple should look like?



More information about the Digitalmars-d-learn mailing list