A Discussion of Tuple Syntax

Dicebot public at dicebot.lv
Mon Aug 19 10:54:20 PDT 2013


On Monday, 19 August 2013 at 17:45:44 UTC, H. S. Teoh wrote:
> On Mon, Aug 19, 2013 at 07:34:38PM +0200, Dicebot wrote:
>> On Monday, 19 August 2013 at 17:22:26 UTC, H. S. Teoh wrote:
>> >What I'd like to know, is how all of these proposals address 
>> >the
>> >fundamental differences between "symbol tuples" (compile-time
>> >construct)
>> 
>> Those are not symbol tuples. For example, `int` is not a 
>> symbol.
>> http://dlang.org/template.html#Symbol - only things that have
>> identifiers and template instances are symbols.
>
> Well, OK, whatever they're supposed to be called. 
> Compiler-tuples, or
> expression tuples, or whatever.

Well, technically they are compile-time tuples of stuff. Yep, 
that bad :) They don't have a good name because they don't have a 
good meaning, only behavior.

> See, part of the problem is that they
> just don't have any good name that correctly conveys what they 
> are.
> Calling them "tuple" only adds to the confusion because of the
> conflation with std.range.Tuple.

std.typecons.Tuple ;) I have noticed it is not the first time you 
want to move it to std.range ;)

Well, you see, they are really both tuples. That is also the 
problem - call them whatever you want but they still both will be 
tuples. Compile-time tuple and run-time tuple, that is it (and I 
was recently surprised to learn that even their implementations 
are deeply tied).

I don't think simply changing a name to something irrelevant will 
magically solve confusion, it is feature in general that need 
clear re-definition in all relevant documentation. "Tuple" entry 
on dlang.org does not mention even half of the truth about it...


More information about the Digitalmars-d mailing list