July 08, 2015
On 7/8/15 1:44 PM, Timon Gehr wrote:
> 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.

Yes, Walter at dconf also (I think) agreed this at least needs to be fixed:

alias Int = int;

template T(alias X) { enum a = 1;}

int x = T!Int.a; // error

In addition, this doesn't work:

alias foo = 2;

But this does:

int x = T!2.a;

I think alias should be the same anywhere you use it. And Alias<insert term here> for a name for what TypeTuple/Arguments/AliasSeq is, seems like an appropriate name given how template aliases work. Not my favorite, but it's at least based in logic.

-Steve
July 08, 2015
On Wednesday, 8 July 2015 at 17:53:05 UTC, Steven Schveighoffer wrote:
> It's plural. How to talk about Aliases? That was my main issue with Arguments.
>
> "use a TypeTuple" -> "use an Aliases"
>
> -Steve

"use Aliases" or "use the Aliases".

I'm not arguing for Aliases but that seems like a non-problem. If something more general is required then Terms or something like that.
July 08, 2015
On Wednesday, 8 July 2015 at 18:01:36 UTC, Steven Schveighoffer wrote:
> On 7/8/15 1:44 PM, Timon Gehr wrote:
>> 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.
>
> Yes, Walter at dconf also (I think) agreed this at least needs to be fixed:
>
> alias Int = int;
>
> template T(alias X) { enum a = 1;}
>
> int x = T!Int.a; // error
>
> In addition, this doesn't work:
>
> alias foo = 2;
>
> But this does:
>
> int x = T!2.a;
>
> I think alias should be the same anywhere you use it. And Alias<insert term here> for a name for what TypeTuple/Arguments/AliasSeq is, seems like an appropriate name given how template aliases work. Not my favorite, but it's at least based in logic.
>
> -Steve

Yes, yes, yes, 20 times yes. There are some quirks with what can be aliased depending on how the alias is declared, this needs to be unified.

The thing we are naming here is some collection of aliases. Talking to everybody, the 2 names that came up frequently for this collection are List and Sequence. I personally don't mind, but Walter had strong views against List, so I went for Sequence.

Now we should decide for a term for this entity we have in D that is kind of tuple but auto unpack. This construct does not exists in other languages, so, as explained by Jonathan, no existing name will fit 100% . I'd say we pick some name that evoke an ordered collection and that which is not already used for some existing construct in D (which rules out array for instance) or have a well defined meaning (like tuple).

Sequence fit the bill. I don't mind using another name that fit the bill as well. Nobody came up with that name yet.
July 08, 2015
On Wednesday, 8 July 2015 at 18:01:36 UTC, Steven Schveighoffer wrote:
> In addition, this doesn't work:
>
> alias foo = 2;

I think you are right that that should be allowed, but just out of curiosity, if that was allowed, then what would the purpose of enum be?
July 08, 2015
On Wednesday, 8 July 2015 at 20:14:55 UTC, Tofu Ninja wrote:
> On Wednesday, 8 July 2015 at 18:01:36 UTC, Steven Schveighoffer wrote:
>> In addition, this doesn't work:
>>
>> alias foo = 2;
>
> I think you are right that that should be allowed, but just out of curiosity, if that was allowed, then what would the purpose of enum be?

enum has all kind of bizare rules for arrays for instance. I'm not sure how justified it is to begin with, but that it is in and everybody uses them enum has its place is there to stay.
July 08, 2015
On Wednesday, 8 July 2015 at 20:11:16 UTC, deadalnix wrote:
> Sequence fit the bill. I don't mind using another name that fit the bill as well. Nobody came up with that name yet.

I find that naming objects is a key part of programming, and to that end I own one copy of Roget's International Thesaurus (Crowell, 4th edition -- a quality thesaurus, not a cheap junk book) at work, and another copy that I keep at home.  It's the best reference I know of to jog your thinking out of a rut when you need some synonym that is just beyond your mental reach.

Looking up the concept in this case yields words like "series", "chain", and "train".  There are lots more choices, but those are some of the simple, short ones.  So we could have AliasSeries or SerialAliases, AliasChain, etc.  I'm not saying I'm in favor of any of these in particular, or that I'm at all familiar with the underlying idea we're trying to name here; all I'm proposing is a process for generating alternative names.
July 08, 2015
On Wednesday, 8 July 2015 at 22:01:48 UTC, Observer wrote:
> I find that naming objects is a key part of programming, and to that end I own one copy of Roget's International Thesaurus (Crowell, 4th edition -- a quality thesaurus, not a cheap junk book) at work, and another copy that I keep at home.  It's the best reference I know of to jog your thinking out of a rut when you need some synonym that is just beyond your mental reach.

Thats actually a pretty neat idea, I feel like I am going to start doing this when I have trouble naming things.
July 08, 2015
On Wednesday, 8 July 2015 at 09:25:19 UTC, Mike Parker wrote:
> On Wednesday, 8 July 2015 at 09:00:58 UTC, Jonathan M Davis wrote:
>
>> Personally, I'd prefer List over Seq,
>
> Given that "list" has meanings other than "linked list" in several languages (Python and Racket come to mind), I don't see the problem.

Yep C# too:  List<T> is arguably the most used collection in the language, and it's indexable and not linked.

> "In computer science, a list or sequence is an abstract data type that represents a sequence of values, where the same value may occur more than once. An instance of a list is a computer representation of the mathematical concept of a finite sequence; the (potentially) infinite analog of a list is a stream.[1]:ยง3.5 Lists are a basic example of containers, as they contain other values. If the same value occurs multiple times, each occurrence is considered a distinct item.
>
> The name list is also used for several concrete data structures that can be used to implement abstract lists, especially linked lists."
>
> Given the nature of the data structure we're talking about, I think AliasList is a perfect fit. It's shorter than Sequence (the only good alternative I see atm) and List is a whole word, unlike Seq. More importantly, it's quite descriptive. Because of the baggage surrounding "tuple" in D and the use of "array" to already refer to static arrays and dynamic arrays/slices (and a data type in Phobos) I don't see either of those as viable options.

Yep, I totally agree. The term "list" largely depends on context, but even in the software development domain it can be interpreted analagously to "grocery list" or "todo list".  Vetoing AliasList leaves us with nothing good.


July 09, 2015
On 7/8/2015 2:00 AM, Jonathan M Davis wrote:
> On Tuesday, 7 July 2015 at 22:22:02 UTC, Walter Bright wrote:
>> On 7/7/2015 2:20 PM, David Nadlinger wrote:
>>> 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.
>>>
>>> Apparently Walter was opposed to using List, as that would somehow imply "linked
>>> list".
>>
>> I opposed it because lists are not indexable, and tuples are.
>
> Linked lists are not indexable, but the term list doesn't necessarily imply that
> it's a linked list.

It does to me, and in common programming usage "list" is often said instead of "linked list".


> As for Seq, it's kind of ugly, but if understand that it's Sequence, I think
> that that fits well enough. Personally, I'd prefer List over Seq, but if you're
> vetoing List, then I don't know what else we're going to go with. _Nothing_ fits
> perfectly. TypeTuple/AliasSeq/Whatever is just too unique and too much of a
> hodgepodge for any name to really well.

Which is why I simply picked the name Arguments. The s suffix means plural, and doesn't give any preconceived notion about what kind of collection it is. It's a convention I've been using in the dmd source for some time now, and have found it to be natural and pleasing.

July 09, 2015
On Thursday, 9 July 2015 at 00:11:17 UTC, Walter Bright wrote:
> It does to me, and in common programming usage "list" is often said instead of "linked list".

There seems to be a lot of languages that make lists indexable... And the definition of what a list is seems to vary quite a lot.

Languages with something called a list that is indexable...
Java
C#
Python
Perl