Tuple/TypeTuple etc.

Jonathan M Davis jmdavisProg at gmx.com
Fri Aug 16 12:35:40 PDT 2013


On Friday, August 16, 2013 21:23:26 Dicebot wrote:
> On Friday, 16 August 2013 at 19:19:19 UTC, Jonathan M Davis wrote:
> > Since the built-in tuples / std.typetuple.TypeTuple and
> > std.typecons.Tuple
> > are fundamentally different, I don't see how you could possibly
> > combine the two
> > in a single syntax. You'd need different syntaxes for each one.
> 
> The fact that std.typetuple.TypeTuple and built-in ones are
> different is most inconvenient thing in all this situation. They
> should be the same and TypeTuple removed as redundant.

But TypeTuple and the built-in ones _aren't_ different. TypeTuple is an alias 
for the built-in ones that's required because of the lack of syntax for 
declaring them on their own. TypeTuple could just have easily been called 
BuiltInTuple (and would probably have been better named as such, even though 
that name isn't exactly great). It's std.typecons.Tuple which is different.

Adding a syntax for TypeTuple, making TypeTuple redundant would be great, but 
Bearophile seems to be arguing that having some sort of tuple syntax would 
make it so that we don't need TypeTuple and Tuple, which is wrong, because 
they're different. If you're creating a new syntax in the language for one of 
them, you only get rid of the need for one of them in the library, not both. 
The idea of a "universal tuple" (like Bearophile seems to be looking for) 
makes no sense given the differences between the built-in tuples and Tuple.

- Jonathan M Davis


More information about the Digitalmars-d mailing list