Should we deprecate comma?

Dicebot public at dicebot.lv
Mon Mar 24 10:54:09 PDT 2014


On Monday, 24 March 2014 at 17:51:15 UTC, bearophile wrote:
> The difference is that your experience with tuples will be less 
> good. One difference can be seen here. Given an array of tuples 
> (here I am using a shorter syntax):
>
> auto arr = [@{1, 2}, @(3, 4)]
>
> You can't do this:
>
> void foo(int a, int b, int c) {...}
> auto result = arr.map!foo;
>
> And you need:
>
> auto result = arr.map!(t => foo(t.expand));
>
> Or:
>
> auto result = arr.map!(t => foo(t[]));
>
>
> While you can do this:
>
> void foo(in @(int a, int b, int c}) {...}
> auto result = arr.map!foo;

I believe it is dangerous misfeature and I don't want to see this 
in D. Sorry :(


More information about the Digitalmars-d mailing list