s/TypeTuple/AliasSeq/g?

Marc Schütz via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 21 08:22:30 PDT 2015


On Wednesday, 21 October 2015 at 14:25:18 UTC, Shriramana Sharma 
wrote:
> Marc Schütz wrote:
>
>>> BTW "isExpressions" – what kind of singular/plural grammar is 
>>> that?
>> 
>> That's because it refers to the first argument, which is one 
>> symbol, not multiple ones. "consistsOfExpression" would 
>> probably be nicer, but - meh...
>
> No it doesn't refer to the first argument. The code in Phobos 
> is:
>
>     static if (T.length >= 2)
>         enum bool isExpressions =
>             isExpressions!(T[0 .. $/2]) &&
>             isExpressions!(T[$/2 .. $]);
>     else static if (T.length == 1)
>         enum bool isExpressions =
>             !is(T[0]) && __traits(compiles, { auto ex = T[0]; 
> });
>     else
>         enum bool isExpressions = true; // default
>
> So it does check all members of the AliasSeq, and only if all 
> of them are expressions (or at least none of them are types) 
> then it returns true. The counterpart is isTypeTuple.

I was referring to the "left hand side" of that relationship:

     "something" is-a "expressions"

The "is" makes sense if you see it as an "is-a" relationship.

>
>> This should not be renamed, because an AliasSeq that consists 
>> only of expressions _is_ a tuple.
>> 
>> ...
>> We aren't. The only reason we use "AliasSeq" at all instead of
>> "AliasTuple" was that some people insisted they were not 
>> tuples.
>> This does however not apply to all the other things that _are_
>> tuples. Renaming those would only make matters worse.
>
> Heh, I guess you were one of the dissenters during the rename 
> from TypeTuple to AliasSeq. I personally don't have a problem 
> with calling them tuples, and IIUC the main problem was with 
> the word Type since they can contain even expressions,

That is my understanding as well. And the fact that they can 
contain anything, not just values, was another reason for some 
not to call them tuples (which I don't consider important, but it 
was for some).

> but nevertheless it *was* renamed to AliasSeq, and if the 
> library is to have any consistency and professional quality 
> then the rest of the references to "Tuple" (and even some 
> internal "List" references) as against tuples created by 
> `std.typecons.Tuple` should be corrected.

I'm afraid this won't help. One objection was that we're dealing 
with several different unrelated concepts that only superficially 
seem similar, and that all used to be called "tuple". Now, when 
we just mechanically rename them all to "*Seq", we're back where 
we started, just with a different name.


More information about the Digitalmars-d mailing list