July 08, 2015
On Tuesday, 7 July 2015 at 21:15:40 UTC, 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?
>
>
> Andrei

I reckon Collect would be a good name. It describes what you're doing: collecting some things together. Is also fits nicely with the currently private but hugely useful std.typetuple.Pack.


Collect: collect things together to one symbol, but they're not bound together, they'll auto-expand if they can.

Pack: pack things together, they only come apart explicitly (via .expand).


The best thing about it? It doesn't say anything misleading about the contents. It also doesn't say anything confusing about runtime vs compile-time.

Speaking as someone who's written ridiculous numbers of lines of code using TypeTuple and various incarnations of Pack, Collect fits my way of thinking.
July 08, 2015
On Wednesday, 8 July 2015 at 14:45:55 UTC, Xiaoxi wrote:
> On Wednesday, 8 July 2015 at 14:18:20 UTC, Jonathan M Davis wrote:
>>
>> And renaming TypeTuple to Aliases is just going to increase confusion.
>>
>> - Jonathan M Davis
>
> It's basically just __VA_ARGS__ on steroids, thus 'Arguments' is good, there's precedence in C(Args).

LOL. Then what about when you use it for _parameters_ rather than arguments? Or when you use it areas that have _nothing_ to do with functions - e.g.

foreach(S; TypeTuple!(string, char[], wstring, dstring))
{
    //...
}

Naming it Arguments gives the impression that it's specifically related to arguments, and that's just one small area that it gets used in. And that's part of what's so hard about naming it. It just does way too many things to name easily.

- Jonathan M Davis
July 08, 2015
On Wednesday, 8 July 2015 at 16:44:13 UTC, Jonathan M Davis wrote:
> On Wednesday, 8 July 2015 at 14:45:55 UTC, Xiaoxi wrote:
>> On Wednesday, 8 July 2015 at 14:18:20 UTC, Jonathan M Davis wrote:
>>>
>>> And renaming TypeTuple to Aliases is just going to increase confusion.
>>>
>>> - Jonathan M Davis
>>
>> It's basically just __VA_ARGS__ on steroids, thus 'Arguments' is good, there's precedence in C(Args).
>
> LOL. Then what about when you use it for _parameters_ rather than arguments? Or when you use it areas that have _nothing_ to do with functions - e.g.
>
> foreach(S; TypeTuple!(string, char[], wstring, dstring))
> {
>     //...
> }
>
> Naming it Arguments gives the impression that it's specifically related to arguments, and that's just one small area that it gets used in. And that's part of what's so hard about naming it. It just does way too many things to name easily.
>
> - Jonathan M Davis

Not going to say if it is good or bad proposal, but your comment is not strictly relevant - template arguments are also arguments in D. It is exactly the term dlang.org grammar spec uses.
July 08, 2015
On Wednesday, 8 July 2015 at 16:29:25 UTC, John Colvin wrote:
> I reckon Collect would be a good name. It describes what you're doing: collecting some things together. Is also fits nicely with the currently private but hugely useful std.typetuple.Pack.
>
>
> Collect: collect things together to one symbol, but they're not bound together, they'll auto-expand if they can.
>
> Pack: pack things together, they only come apart explicitly (via .expand).
>
>
> The best thing about it? It doesn't say anything misleading about the contents. It also doesn't say anything confusing about runtime vs compile-time.
>
> Speaking as someone who's written ridiculous numbers of lines of code using TypeTuple and various incarnations of Pack, Collect fits my way of thinking.

Let's choose a name the cool kids will like and name it OmniSplat.
July 08, 2015
On 07/08/2015 06:44 PM, Jonathan M Davis wrote:
> On Wednesday, 8 July 2015 at 14:45:55 UTC, Xiaoxi wrote:
>> On Wednesday, 8 July 2015 at 14:18:20 UTC, Jonathan M Davis wrote:
>>>
>>> And renaming TypeTuple to Aliases is just going to increase confusion.
>>>
>>> - Jonathan M Davis
>>
>> It's basically just __VA_ARGS__ on steroids, thus 'Arguments' is good,
>> there's precedence in C(Args).
>
> LOL. Then what about when you use it for _parameters_ rather than
> arguments? Or when you use it areas that have _nothing_ to do with
> functions - e.g.
>
> foreach(S; TypeTuple!(string, char[], wstring, dstring))
> {
>      //...
> }
>
> Naming it Arguments gives the impression that it's specifically related
> to arguments, and that's just one small area that it gets used in. And
> that's part of what's so hard about naming it. It just does way too many
> things to name easily.
>
> - Jonathan M Davis

I assume the rationale is that the thing you get is literally the arguments to the template.

alias Asdf(T...)=T;

Asdf!(string,char[],wstring,dstring)
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     Arguments

It's the identity function on template argument lists. This is needed because those do not have their own syntax.
July 08, 2015
On Wednesday, 8 July 2015 at 17:15:50 UTC, Timon Gehr wrote:
> On 07/08/2015 06:44 PM, Jonathan M Davis wrote:
>> On Wednesday, 8 July 2015 at 14:45:55 UTC, Xiaoxi wrote:
>>> On Wednesday, 8 July 2015 at 14:18:20 UTC, Jonathan M Davis wrote:
>>>>
>>>> And renaming TypeTuple to Aliases is just going to increase confusion.
>>>>
>>>> - Jonathan M Davis
>>>
>>> It's basically just __VA_ARGS__ on steroids, thus 'Arguments' is good,
>>> there's precedence in C(Args).
>>
>> LOL. Then what about when you use it for _parameters_ rather than
>> arguments? Or when you use it areas that have _nothing_ to do with
>> functions - e.g.
>>
>> foreach(S; TypeTuple!(string, char[], wstring, dstring))
>> {
>>      //...
>> }
>>
>> Naming it Arguments gives the impression that it's specifically related
>> to arguments, and that's just one small area that it gets used in. And
>> that's part of what's so hard about naming it. It just does way too many
>> things to name easily.
>>
>> - Jonathan M Davis
>
> I assume the rationale is that the thing you get is literally the arguments to the template.
>
> alias Asdf(T...)=T;
>
> Asdf!(string,char[],wstring,dstring)
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>      Arguments
>
> It's the identity function on template argument lists. This is needed because those do not have their own syntax.

Sure, but they could also represent a template's parameters, not just the arguments. It all depends on what you're using the TypeTuple for.

- Jonathan M Davis
July 08, 2015
On Wednesday, 8 July 2015 at 17:09:14 UTC, Dicebot wrote:
> On Wednesday, 8 July 2015 at 16:44:13 UTC, Jonathan M Davis wrote:
>> Naming it Arguments gives the impression that it's specifically related to arguments, and that's just one small area that it gets used in. And that's part of what's so hard about naming it. It just does way too many things to name easily.
>>
>> - Jonathan M Davis
>
> Not going to say if it is good or bad proposal, but your comment is not strictly relevant - template arguments are also arguments in D. It is exactly the term dlang.org grammar spec uses.

Yes, but TypeTuple isn't just used for template arguments - or function arguments. In other circumstances, it's used for parameters or even for stuff that has nothing to do with either - e.g. in a foreach loop.

- Jonathan M Davis
July 08, 2015
On Wednesday, 8 July 2015 at 17:21:06 UTC, Jonathan M Davis wrote:
> Sure, but they could also represent a template's parameters, not just the arguments. It all depends on what you're using the TypeTuple for.

No matter what they represent, they ARE template arguments. That is a simple identity, as Timon has mentioned. Your reasoning is similar to saying that variables shouldn't be called variables because they can be immutable (not necessarily immutable in language terms but logically).

Trying to name argument lists by their usage pattern is doomed from the very beginning because they have many absolutely unrelated applications.
July 08, 2015
On 07/08/2015 11:38 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm@gmx.net>" wrote:
>
>
> I like "AliasTuple" as suggested by Martin, although it isn't a perfect
> fit either when you think of `alias` template params, which don't match
> `int`, while `int` can be an element of a TypeTuple.

But this works: alias Int = int;

The right fix for this issue is to fix the language. This does not make any sense.
July 08, 2015
On 7/8/15 5:49 AM, ixid wrote:
> On Wednesday, 8 July 2015 at 09:13:27 UTC, Jonathan M Davis wrote:
>> Has anyone come up with anything other than Tuple, Array, List, or
>> Seq? Simply throwing an "s" on the end like they did with Arguments?
>> Then we have Aliases. I doubt that that's a good idea, but it would be
>> an option.
>
> What's wrong with Aliases?

It's plural. How to talk about Aliases? That was my main issue with Arguments.

"use a TypeTuple" -> "use an Aliases"

-Steve