Wait, what? What is AliasSeq?

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 9 04:34:56 PDT 2015


On 7/8/15 2:22 PM, ixid wrote:
> On Wednesday, 8 July 2015 at 17:53:05 UTC, Steven Schveighoffer wrote:
>> It's plural. How to talk about Aliases? That was my main issue with
>> Arguments.
>>
>> "use a TypeTuple" -> "use an Aliases"
>>
>> -Steve
>
> "use Aliases" or "use the Aliases".
>
> I'm not arguing for Aliases but that seems like a non-problem. If
> something more general is required then Terms or something like that.

It still doesn't read correctly.

I'll give you an example from 
std.meta:https://github.com/D-Programming-Language/phobos/blob/master/std/meta.d#L146

"Returns a typetuple created from TList with the first occurrence, if 
any, of T removed."

Possible options:

"Returns Aliases created from TList with the first occurrence, if any, 
of T removed."

"Returns the Aliases created from TList with the first occurrence, if 
any, of T removed."

"Returns an instance of Aliases created from TList with the first 
occurrence, if any, of T removed."

I don't like them. However, use AliasSeq:

"Returns an AliasSeq created from TList with the first occurrence, if 
any, of T removed."

The difference is subtle, but definitely clearer and less awkward.

BTW, others have argued that typetuple above doesn't refer to the 
TypeTuple type, but the actual typetuple concept as described in the 
spec (a tuple of types). However, in this case, TList doesn't have to be 
strictly types, so this is not correct. So this should be changed.

The more I think about this, I think AliasTuple is probably the best 
answer. We have "type tuples" and "value tuples", "alias tuples" seems 
like a natural fit.

-Steve


More information about the Digitalmars-d mailing list