Pair literal for D language

Mason McGill via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 28 09:11:14 PDT 2014


On Saturday, 28 June 2014 at 09:15:29 UTC, Dicebot wrote:
> On Friday, 27 June 2014 at 22:01:21 UTC, Mason McGill wrote:
>> I like DIP54 and I think the work on fixing tuples is awesome, 
>> but I have 1 nit-picky question: why is it called 
>> "TemplateArgumentList" when it's not always used as template 
>> arguments?
>>
>>  void func(string, string) { }
>>
>>  TypeTuple!(string, string) var;
>>  var[0] = "I'm nobody's ";
>>  var[1] = "template argument!";
>>  f(var);
>>
>> Why not a name that emphasizes the entity's semantics, like 
>> "StaticList"/"ExpandingList"/"StaticTuple"/"ExpandingTuple"?
>
> Because it is defined by template argument list and has exactly 
> the same semantics as one. And semantics are unique and obscure 
> enough that no other name can express it precisely.

Understood. I was just expressing my initial impression: that it 
seemed strange that a symbol declared as a `TemplateArgumentList` 
was neither passed nor received as template arguments.


More information about the Digitalmars-d mailing list