Declaring Ref Variables Inside Function Calls

Sergey Gromov snake.scaly at gmail.com
Tue Mar 31 18:49:08 PDT 2009


Tue, 31 Mar 2009 18:38:35 -0700, Andrei Alexandrescu wrote:

> Sergey Gromov wrote:
>> Comma expression is not ambiguous.  It's a comma expression.  Renaming
>> it into a tuple constructor expression does not add any ambiguity.
>> Parentheses here are only required to separate the comma expression from
>> an assignment expression which otherwise would become a part of comma
>> expression.  Sure there are problems with making tuples first-class, but
>> this is certainly not one of them.
> 
> I don't understand. So are you suggesting that the comma expression gets 
> sacked?

Now comma expression drops all the results but the last one.  You lose
nothing by making it keep other results as well.  Then you can make it
extract the last element as a result of an implicit cast.

Disallowing the C-style usage of comma expression is also an option.

>> I'm putting together a blog post about a possible design of first-class
>> tuples in D.  Hope it won't take too long.
> 
> What does "first-class" mean?

First-class values, like, native, with built-in compiler support.



More information about the Digitalmars-d mailing list