Wait, what? What is AliasSeq?

via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 8 02:38:02 PDT 2015


On Tuesday, 7 July 2015 at 21:15:40 UTC, Andrei Alexandrescu 
wrote:
> So I thought we were supposed to replace bad names with good 
> names. Template arguments are indexable, so "sequence" doesn't 
> quite apply.
>
> What happened? Why are we replacing a crappy term with another 
> crappy term?

I also saw this change and was horrified. It just replaced one 
bad named (Arguments) by another. I just didn't want to stir up 
further trouble. But now that it's on the table, here's my 
opinion:

For me, "sequence" always reminds me of the mathematical concept, 
where elements are of the same type (e.g. only real numbers, but 
not a mixture of scalars and vectors), and usually each element 
has some relation to either its predecessor, or its index. This 
doesn't fit with TypeTuples at all.

Likewise, an array (at least in D) always has exactly one element 
type. This doesn't apply to TypeTuples either.

The name I find most fitting to describe them is "tuple". The 
trouble with the former name is that it implies them being a 
tuple of types, although they don't need to be. So IMO we just 
need to find a better specifier.

(Personally I would be fine with "list", too, but Walter finds it 
misleading.)

I like "AliasTuple" as suggested by Martin, although it isn't a 
perfect fit either when you think of `alias` template params, 
which don't match `int`, while `int` can be an element of a 
TypeTuple. Alternatively "ArgumentsTuple", or 
"TemplateArgumentsTuple", but the latter is too long.


More information about the Digitalmars-d mailing list