DIP19: Remove comma operator from D and provision better syntactic support for tuples

deadalnix deadalnix at gmail.com
Tue Sep 25 03:10:30 PDT 2012


Le 24/09/2012 16:59, foobar a écrit :
> I'm a bit confused about what is specifically proposed here:
> - Is the suggestion to limit tuples to >1 elements? *This* I'm against
> for practical as well as completeness reasons. Andrei already provided
> one example, and another would be a proper unit type. e.g.
> void foo(int a) {}
> void bar (int b) { return foo(b); }
> - Is the suggestion to allow implicit conversion between (T) and T?
> This brings almost no benefit - (you save two keystrokes?) and adds a
> special case to the language. The added complexity really does not
> justify this.

In fact, they don't need to unpack only for 1 element tuples, but this 
is the tricky case. Today, tuples auto unpack on function call for 
instance :

auto t = tuple (1, 2);
foo(t); // call foo(int, int)


More information about the Digitalmars-d mailing list