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

Reply via email to