Pair literal for D language

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 28 02:15:28 PDT 2014


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.

'StaticList' is what you may have wanted it to be but not what it 
is.


More information about the Digitalmars-d mailing list