July 16, 2015 Re: Wait, what? What is AliasSeq? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On Thursday, 16 July 2015 at 05:28:15 UTC, Ola Fosheim Grøstad wrote:
> std::forward_list
Forget that one, that actually would be a single linked list… :P And in C++ you also have "std::integer_sequence" for compile time parameters.
But I think "sequence" implies that everything has the same type...
|
July 16, 2015 Re: Wait, what? What is AliasSeq? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | Oh, here is one more term you can consider: "AliasPack" In Python "splatting" is called "unpacking" ("splat" refers to the visual impression of the "*" operator and is inappropriate). C++ also have related use of the word "pack": http://en.cppreference.com/w/cpp/language/parameter_pack So in C++ all of the terms "list", "sequence" and "pack" can be used about parameter lists… but "list" is the general term: argument list, parameter list, initializer list etc… |
July 16, 2015 Re: Wait, what? What is AliasSeq? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On Thursday, 16 July 2015 at 05:44:29 UTC, Ola Fosheim Grøstad wrote:
>
> C++ also have related use of the word "pack":
>
> http://en.cppreference.com/w/cpp/language/parameter_pack
>
Nice! From the description:
"A template parameter pack is a template parameter that accepts zero or more template arguments (non-types, types, or templates). A function parameter pack is a function parameter that accepts zero or more function arguments.
A template with at least one parameter pack is called a variadic template."
Sound familiar? I propose simply "Pack".
Mike
|
July 16, 2015 Re: Wait, what? What is AliasSeq? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike | On Thursday, 16 July 2015 at 05:51:01 UTC, Mike wrote:
> Sound familiar? I propose simply "Pack".
Or "AliasListPack", "AliasPackList", "PackedAliasList"…
(I'd hate to see the thread die…)
|
July 16, 2015 Re: Wait, what? What is AliasSeq? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On Thursday, 16 July 2015 at 05:55:01 UTC, Ola Fosheim Grøstad wrote:
> On Thursday, 16 July 2015 at 05:51:01 UTC, Mike wrote:
>> Sound familiar? I propose simply "Pack".
>
> Or "AliasListPack", "AliasPackList", "PackedAliasList"…
Or would it be "UnpackingAliasList" or "UnpackedAliasList"? Oh… Headaches…
|
July 16, 2015 Re: Wait, what? What is AliasSeq? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 2015-07-07 23:16, Andrei Alexandrescu wrote: > So I thought we were supposed to replace bad names with good names. > Template arguments are indexable, so "sequence" doesn't quite apply. > > What happened? Why are we replacing a crappy term with another crappy term? How about "Bag" or "AliasBag"? -- /Jacob Carlborg |
July 16, 2015 Re: Wait, what? What is AliasSeq? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | On 2015-07-15 23:44, Timon Gehr wrote: > It should instead be acknowledged that there /should/ be no difference > in what three things can be passed to X(T...) and X(alias a, alias b, > alias c). The X(T...) if(T.length==k) pattern is ridiculous. I completely agree. -- /Jacob Carlborg |
July 16, 2015 Re: Wait, what? What is AliasSeq? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On Thursday, 16 July 2015 at 06:32:15 UTC, Jacob Carlborg wrote:
> On 2015-07-07 23:16, Andrei Alexandrescu wrote:
>> So I thought we were supposed to replace bad names with good names.
>> Template arguments are indexable, so "sequence" doesn't quite apply.
>>
>> What happened? Why are we replacing a crappy term with another crappy term?
>
> How about "Bag" or "AliasBag"?
A "bag" is the same as a C++ multi-set.
Let's go over the common usage:
"list": finite ordered source of entities
"tuple": in math it is a fixed length list of values, in programming it usually has semantics close to a record/struct with numbers instead of field names and structural typing.
"sequence": infinite or finite list of values of the same kind/type
"bag": unordered list
"set": bag with unique entities
"array": run-time indexable bag
|
July 16, 2015 Re: Wait, what? What is AliasSeq? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ola Fosheim Grøstad | On Thursday, 16 July 2015 at 07:14:34 UTC, Ola Fosheim Grøstad wrote:
> "array": run-time indexable bag
Eh... not bag, bag often means value semantics without identity...
"array": run-time indexable collection of entities.
|
July 16, 2015 Re: Wait, what? What is AliasSeq? - `Pack` Proposal | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike | On Thursday, 16 July 2015 at 05:51:01 UTC, Mike wrote: >> C++ also have related use of the word "pack": >> >> http://en.cppreference.com/w/cpp/language/parameter_pack > > I propose simply "Pack". > I know Ola is making light of this situation and many of you find this discussion beneath you, but we need a name, and with the release looming we need it relatively soon. I've creating a pull request for "Pack" (https://github.com/D-Programming-Language/phobos/pull/3494) which is inspired by C++'s parameter_pack as linked in the previous post. From the description: "A template parameter pack is a template parameter that accepts zero or more template arguments (non-types, types, or templates). A function parameter pack is a function parameter that accepts zero or more function arguments. A template with at least one parameter pack is called a variadic template." Given that that D has its roots in C++ and this construct is similar to the one in question, it seems like a good fit. I prefer `Pack` over `AliasPack` or other variations because it's more general and allows us to be more specific in the future with `TypePack`, `ExpressionPack`, `AliasPack`, etc... later, but I'll be happy to change it if that's what you all wish. Ultimately, though, it's going to be a judgment call, and I hope having a pull request ready to go makes things easier on those who have to make the call. If it doesn't work, you know where the close button is. Mike |
Copyright © 1999-2021 by the D Language Foundation