Sergey Gromov wrote:
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.

That won't work because you'd paste C code into your D code and it'll
compile with different results.

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

Ok.

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.

A tuple is a parameterized type, not a value. And first-class doesn't mean with built-in compiler support.


Andrei

Reply via email to