[phobos] Fwd: Tuple, TypeTuple, tupleof etc

Andrei Alexandrescu andrei at erdani.com
Mon Jan 3 17:04:14 PST 2011


I think the name "Tuple" is fine. You are right that "TypeTuple" is 
misleading. I suggest we call it "AliasTuple" because it essentially 
holds aliases.

Probably .tupleof will be difficult to change at this point.


Andrei

On 10/4/10 4:08 PM, Shin Fujishiro wrote:
> It's about the messy situation around tuple nomenclature in Phobos:
>
>   - TypeTuple can contain values too
>   - Tuple is different from TypeTuple
>   - tupleof is not a Tuple but a TypeTuple consisting of values
>
> Note also that "Tuple" has packed semantics and "TypeTuple" has
> expanded semantics.  The two are really different in many aspects.
> What to do with them?
>
>
> Shin
>
> On July 6, bearophile posted to the newsgroup:
>
>> You have a "tupleof" struct attribute that gives a TypeTuple, and it
>> can contain values too and not just types, and then you have a Tuple in
>> Phobos that is something similar, but not exactly the same as, a
>> TypeTuple. You can return a Tuple but not a TypeTuple. All this is
>> messy, D newbies will have troubles. Having two slightly different
>> kinds of tuples in a language is bad, but mixing their names in those
>> ways is even worse.
>>
>> In my dlibs1 what's called Tuple is named Record and what's named
>> TypeTuple is named Tuple, this is better because a record is quite
>> similar to a struct (as named in Pascal-like languages too), while a
>> Tuple is named tuple in the language too.  The name "Record" is bad for
>> this purpose because while it's structurally a struct, from an usage
>> point of view it's more like a mathematical tuple.
>>
>> In the end I still think "Record" and "Tuple" are better names, despite
>> their faults. Please think of the newbies :-) Can those two names in
>> Phobos2 be changed?
>
> http://www.digitalmars.com/d/archives/digitalmars/D/Tuple_TypeTuple_tupleof_etc_113005.html
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


More information about the phobos mailing list