2014-03-24 10:09 GMT+09:00 bearophile <bearophileHUGS@lycos.com>:
Andrei Alexandrescu:

Discuss: https://github.com/D-Programming-Language/dmd/pull/3399

Regarding the "progress", I'd like a good built-in syntax to unpack tuples in assignments, inside function signatures, in foreach statements, and more, because the syntactic contortions I currently adopt to use tuples in D are bad.

I'm partially against to it.

1. I think removing comma operator does not have useful effect for tuple syntax discussion. For example:

   1a. If you want to use parenthesis syntax (...) for tuple, we should resolve one-element tuple ambiguity first.
         (exp)   // one-element tuple, or just an expression ?
      And,  removing comma operator does not resolve this issue.

   1b. If you choose other syntax for tuple, comma operator will be no longer related to tuple syntax discussion.
        {exp, exp2}  // eg. using brace for tuple syntax no longer touch to comma operator

2. Indeed in some case comma operator is bug-prone, but if it is used directly on the ExpStatement, it's still useful to me.

    foreach (e; exp1, exp2) {}   // maybe bug?
    if (cond) exp1, exp2;   // in most case, this is not a bug.

   So, completely removing comma operator will cause negative affect in some cases.

Kenji Hara