Changing the behavior of the comma operator

bearophile bearophileHUGS at lycos.com
Fri Mar 28 02:15:18 PDT 2014


Kagamin:

> The problem with tuples is not syntax, but semantics: DIP32 
> should specify, when automatic unpacking happens and when 
> doesn't, that's a very sloppy feature, so it should be 
> specified better.

OK. (But from the last posts on the topic Andrei seems unfit to 
design D tuples).


> Other corner cases I can think about: is one-element tuple 
> equivalent to that one element,

Nope, this is sloppy.


> is array literal a tuple,

Nope. But some explicit conversions are useful.


> is string literal a tuple,

The same as arrays.


> how to infer packed and unpacked tuples,

I don't understand.


> how to remember all these subtle features?

Really, a well designed tuple type is a very simple datatype. So 
a well designed tuple has a natural syntax and a very simple 
semantics with no corner cases, that is easy to remember. If it 
gets hard to remember, it should be redesigned or simplified.

Bye,
bearophile


More information about the Digitalmars-d mailing list