On Fri, Aug 16, 2013 at 06:08:36PM +0200, bearophile wrote:
> John Colvin:
> 
> >Possible solutions:
> 
> My vote is for solution n.5:
> 
> Add the built-in t{} syntax to denote all kind of tuples.
[...]

This can be part of the solution, but by itself is not good enough,
because the so-called "typetuple" and std.typecons.Tuple are NOT the
same thing. They are completely unrelated types, in fact incompatible
concepts, and we need some way to indicate that they aren't the same
thing. Otherwise they will continue to cause confusion.

The so-called "typetuple" (what dmd calls a "tuple") is a compile-time
construct that can contain types, aliases, compile-time values, etc.,
that only exist at compile-time. On the contrary, std.typecons.Tuple is
a runtime object that contains a sequence of values stored in memory (it
has nothing to do with what dmd calls a "tuple"). The two are NOT the
same thing.

I think a good start is to call them by different names. The word
"tuple" is just too overloaded right now, and using the same term to
refer to two incompatible things is just formula for endless confusion.
"Sequence" is OK, but risks confusion with std.range.sequence. Is there
a better word for it? Maybe an acronym -- CTS (compile-time sequence)?


T

-- 
Guns don't kill people. Bullets do.

Reply via email to