Should the comma operator be removed in D2?

Lutger lutger.blijdestijn at gmail.com
Mon Nov 16 14:27:41 PST 2009


dsimcha wrote:

> == Quote from Lutger (lutger.blijdestijn at gmail.com)'s article
...
>> int a = 1;
>> int b = --a, ++a;
>> assert(b == 1);
>> assert(a == 1);
> 
> Axe.  Looks like the only things it's good for are making code undreadable
> and abusing for loop syntax to...
> 
> Make code unreadable.
> 
> When the heck would this be significantly more readable, safer, or more
> concise
> than doing the equivalent without it?  Also, from previous discussions I
> vaguely remember it's constraining other parts of the syntax.

Those discussions were about nice native tuple syntax. The only argument in 
favor of the comma operator I can remember is code-generation.



More information about the Digitalmars-d mailing list