Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
August 21, 2013 s/type tuple/template pack/g please | ||||
---|---|---|---|---|
| ||||
There's an inordinate amount of confusion around what we currently call "type tuple" (embodied in std's TypeTuple). I've been furious immediately as I got word that Walter called it that way, and it hasn't failed to make everybody else feel the same over the years. So: shall we use "template pack" going forward exclusively whenever we refer to that stuff? That way we can unambiguously use "tuple" for "value tuples, i.e. like mini-structs that group values together". Destroy. I mean criticize. Andrei |
August 21, 2013 Re: s/type tuple/template pack/g please | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Wednesday, 21 August 2013 at 17:53:21 UTC, Andrei Alexandrescu wrote:
> So: shall we use "template pack" going forward exclusively whenever we refer to that stuff? That way we can unambiguously use "tuple" for "value tuples, i.e. like mini-structs that group values together".
>
> Destroy. I mean criticize.
Yes, let's make sure to avoid any undue confusion.
|
August 21, 2013 Re: s/type tuple/template pack/g please | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Wednesday, 21 August 2013 at 17:53:21 UTC, Andrei Alexandrescu wrote: > There's an inordinate amount of confusion around what we currently call "type tuple" (embodied in std's TypeTuple). I've been furious immediately as I got word that Walter called it that way, and it hasn't failed to make everybody else feel the same over the years. > > So: shall we use "template pack" going forward exclusively whenever we refer to that stuff? That way we can unambiguously use "tuple" for "value tuples, i.e. like mini-structs that group values together". > > Destroy. I mean criticize. > > Andrei http://forum.dlang.org/post/lrycaqlrtwylhbxfifyz@forum.dlang.org ;) > Define two distinct built-in "tuples": > > - Template argument sequence: may contain anything that is legal template > argument. > - Value tuple or simply "tuple": may contain any values, including run-time > values. Value storage location is not defined. "pack" is dangerous word to chose until packing/unpacking semantics are set in stone. |
August 21, 2013 Re: s/type tuple/template pack/g please | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Wednesday, 21 August 2013 at 17:53:21 UTC, Andrei Alexandrescu wrote:
> There's an inordinate amount of confusion around what we currently call "type tuple" (embodied in std's TypeTuple). I've been furious immediately as I got word that Walter called it that way, and it hasn't failed to make everybody else feel the same over the years.
>
> So: shall we use "template pack" going forward exclusively whenever we refer to that stuff? That way we can unambiguously use "tuple" for "value tuples, i.e. like mini-structs that group values together".
"template pack" isn't really clearer to me than "type tuple", IMO: Both only mean what we want them to mean (Kind of like RAII).
If we want to be clearer/more accurate, then something along the lines of "variadic pack" or "variadic list" would be more descriptive.
|
August 21, 2013 Re: s/type tuple/template pack/g please | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Wednesday, 21 August 2013 at 17:53:21 UTC, Andrei Alexandrescu wrote:
> So: shall we use "template pack" going forward exclusively whenever we refer to that stuff?
Yes, we need do do something about this, and the sooner, the better.
However, I am not particularly happy with the name "template pack", for two reasons:
a) To me, the name suggests that a "template pack" would consist of templates. In this regard, I'd prefer "parameter pack", which also seems to catch on in the C++ community for the (almost, but not entirely dis-)similar C++11 construct.
b) "Pack" is somewhat unintuitive for an entity that is automatically unpacked in many contexts. For example, std.typetuple (internally) defines a "Pack" template that is used precisely for avoiding that intrinsic property of argument lists.
Personally, I like using "Seq" as the name for the constructor template, as do a few other of the GitHub/NG regulars, so maybe "(parameter/variadic/…) sequence" would be an alternative worth discussing?
In any case, I'd be fine with almost any color for the bike shed, as long as it is not the current one. ;)
David
|
August 21, 2013 Re: s/type tuple/template pack/g please | ||||
---|---|---|---|---|
| ||||
Posted in reply to monarch_dodra | On 8/21/13 11:10 AM, monarch_dodra wrote:
> On Wednesday, 21 August 2013 at 17:53:21 UTC, Andrei Alexandrescu wrote:
>> There's an inordinate amount of confusion around what we currently
>> call "type tuple" (embodied in std's TypeTuple). I've been furious
>> immediately as I got word that Walter called it that way, and it
>> hasn't failed to make everybody else feel the same over the years.
>>
>> So: shall we use "template pack" going forward exclusively whenever we
>> refer to that stuff? That way we can unambiguously use "tuple" for
>> "value tuples, i.e. like mini-structs that group values together".
>
> "template pack" isn't really clearer to me than "type tuple", IMO: Both
> only mean what we want them to mean (Kind of like RAII).
>
> If we want to be clearer/more accurate, then something along the lines
> of "variadic pack" or "variadic list" would be more descriptive.
I agree. Let's have an epic debate once and for all for the right name, and then use it consistently. This is one of those instances in which it becomes painfully obvious that names do matter.
Andrei
|
August 21, 2013 Re: s/type tuple/template pack/g please | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On Wednesday, 21 August 2013 at 17:53:21 UTC, Andrei Alexandrescu wrote: > There's an inordinate amount of confusion around what we currently call "type tuple" (embodied in std's TypeTuple). I've been furious immediately as I got word that Walter called it that way, and it hasn't failed to make everybody else feel the same over the years. > > So: shall we use "template pack" going forward exclusively whenever we refer to that stuff? That way we can unambiguously use "tuple" for "value tuples, i.e. like mini-structs that group values together". > > Destroy. I mean criticize. > > > > Andrei There are a lot of good names for it: Template Pack, Type Sequence, Template Argument List, Type List, etc. I think I like Type Sequence the best but any will do. All that really matters is getting Tuple out of the name to clear up the confusion. http://dlang.org/tuple.html is so confusing to anyone who has used tuples in other languages. It doesn't even mention typecons' Tuples which is what anyone who would click on that link would be looking for. It also might be a good time to clear some things up about them in the spec (and possibly implementation). Timon's link to http://wiki.dlang.org/The_D_Programming_Language/Seq shows some areas where they are inconsistent or confusing. |
August 21, 2013 Re: s/type tuple/template pack/g please | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | On Wednesday, 21 August 2013 at 18:21:39 UTC, Brad Anderson wrote:
> There are a lot of good names for it: Template Pack, Type Sequence, Template Argument List, Type List, etc. I think I like Type Sequence the best but any will do. All that really matters is getting Tuple out of the name to clear up the confusion.
Please, nothing with "Type" in its name. How can you call a "type sequence" thing that does not contain types? Same confusion.
|
August 21, 2013 Re: s/type tuple/template pack/g please | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | On 8/21/13 11:21 AM, Brad Anderson wrote:
> On Wednesday, 21 August 2013 at 17:53:21 UTC, Andrei Alexandrescu wrote:
>> There's an inordinate amount of confusion around what we currently
>> call "type tuple" (embodied in std's TypeTuple). I've been furious
>> immediately as I got word that Walter called it that way, and it
>> hasn't failed to make everybody else feel the same over the years.
>>
>> So: shall we use "template pack" going forward exclusively whenever we
>> refer to that stuff? That way we can unambiguously use "tuple" for
>> "value tuples, i.e. like mini-structs that group values together".
>>
>> Destroy. I mean criticize.
>>
>>
>>
>> Andrei
>
> There are a lot of good names for it: Template Pack, Type Sequence,
> Template Argument List, Type List, etc. I think I like Type Sequence the
> best but any will do. All that really matters is getting Tuple out of
> the name to clear up the confusion.
We much more need to get "type" out of the name. Those aren't types.
Andrei
|
August 21, 2013 Re: s/type tuple/template pack/g please | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | On Wednesday, 21 August 2013 at 18:21:39 UTC, Brad Anderson wrote:
> I think I like Type Sequence the best but any will do.
I think we should make sure to drop "type" from the name – to me, it seems like one of the major points of confusion with TypeTuple is that they do not only consist of types.
David
|
Copyright © 1999-2021 by the D Language Foundation