s/TypeTuple/AliasSeq/g?
Shriramana Sharma via Digitalmars-d
digitalmars-d at puremagic.com
Wed Oct 21 07:25:11 PDT 2015
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.
> 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, 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.
--
Shriramana Sharma, Penguin #395953
More information about the Digitalmars-d
mailing list