July 09, 2015
It is a compiletime tuple so i'd vote for:
CtTuple
July 09, 2015
On Thursday, 9 July 2015 at 14:29:55 UTC, Zoadian wrote:
> It is a compiletime tuple so i'd vote for:
> CtTuple

Too bad it is not a tuple and it is not exclusively compile time. Otherwise, that'd be a great name.
July 09, 2015
On Thursday, 9 July 2015 at 15:03:25 UTC, deadalnix wrote:
> On Thursday, 9 July 2015 at 14:29:55 UTC, Zoadian wrote:
>> It is a compiletime tuple so i'd vote for:
>> CtTuple
>
> Too bad it is not a tuple and it is not exclusively compile time. Otherwise, that'd be a great name.

Really? Proof to the contrary: it cant be indexed without first being copied into a runtime construct, its as much compiletime only as UDAs are.

alias Tuple(Args...) = Args;
int main(string args[])
{
  return Tuple!(1,2)[args.length];
}
July 09, 2015
On Thursday, 9 July 2015 at 15:03:25 UTC, deadalnix wrote:
> On Thursday, 9 July 2015 at 14:29:55 UTC, Zoadian wrote:
>> It is a compiletime tuple so i'd vote for:
>> CtTuple
>
> Too bad it is not a tuple [...]

Quoting from https://en.wikipedia.org/wiki/Tuple :

> A tuple is a finite ordered list of elements.

- finite: check
- ordered: check
- list of elements: check

Fits perfectly.

Interestingly, it goes on by saying:

> An n-tuple is defined inductively using the construction
> of an ordered pair.

Although not stated explicitly, this implies (a kind of) auto expanding!
=> Fits more than perfectly :-P
July 09, 2015
On Thursday, 9 July 2015 at 18:45:56 UTC, Marc Schütz wrote:
> Interestingly, it goes on by saying:
>
>> An n-tuple is defined inductively using the construction
>> of an ordered pair.
>
> Although not stated explicitly, this implies (a kind of) auto expanding!
> => Fits more than perfectly :-P

No one who has ever seriously used tuples in any programming language I've ever heard of would expect tuples to auto expand. Auto expansion makes them _considerably_ less useful. In the case of TypeTuple/AliasSeq, the situation is a bit different, because we're not really talking about tuples here. Real tuples nest, and they don't auto expand. TypeTuple/AliasSeq is the _only_ case I've ever seen where someone tried to claim that something was a tuple when it didn't nest, or it auto-expanded. Folks have been consistently confused about the differences between TypeTuple and std.typecons.Tuple and the fact that TypeTuples auto expand. No one expects it - because tuples just don't do that in any actual programming languages. I question the validity of your interpretation of the theory as well, but even if it's valid, it doesn't match what's done in actual programming languages.

- Jonathan M Davis
July 09, 2015
On 7/9/2015 12:56 AM, deadalnix wrote:
> Several of which actually use linked list for list and probably shouldn't
> provide random access.

Yes. Consider:

    for (int i = 0; i < list.length; ++i)
          sum += list[i];

If indexing was allowed on a list, this would seem like perfectly reasonable code.
July 09, 2015
On Thu, Jul 09, 2015 at 07:10:38PM +0000, Jonathan M Davis via Digitalmars-d wrote:
> On Thursday, 9 July 2015 at 18:45:56 UTC, Marc Schütz wrote:
> >Interestingly, it goes on by saying:
> >
> >>An n-tuple is defined inductively using the construction
> >>of an ordered pair.
> >
> >Although not stated explicitly, this implies (a kind of) auto expanding!  => Fits more than perfectly :-P
> 
> No one who has ever seriously used tuples in any programming language I've ever heard of would expect tuples to auto expand. Auto expansion makes them _considerably_ less useful.

FWIW, Perl arrays auto-expand (or more precisely, auto-denest), unless you force them not to by taking a reference to the subarray instead. I'm not sure if this behaviour has changed in the newest version of Perl, but it was the cause of much confusion to new learners.

Not the same thing as tuples, I know, but somebody *did* propose the name "array" for D's auto-expanding whatchamacallit.


T

-- 
Curiosity kills the cat. Moral: don't be the cat.
July 09, 2015
On Thursday, 9 July 2015 at 19:10:39 UTC, Jonathan M Davis wrote:
> On Thursday, 9 July 2015 at 18:45:56 UTC, Marc Schütz wrote:
>> Interestingly, it goes on by saying:
>>
>>> An n-tuple is defined inductively using the construction
>>> of an ordered pair.
>>
>> Although not stated explicitly, this implies (a kind of) auto expanding!
>> => Fits more than perfectly :-P
>
> No one who has ever seriously used tuples in any programming language I've ever heard of would expect tuples to auto expand.

You're right. And after all of the discussion, I like the name AliasSeq more.
The fact that it sometimes elicits a 'WTF' reaction is perfect; it's a D thing (or a 'not normally exposed to the programmer thing') so you need to look up what it does. Using Tuple, List, or Array in the name is unhelpful, as those names are used a lot already.



July 09, 2015
On 7/7/15, Andrei Alexandrescu via Digitalmars-d <digitalmars-d@puremagic.com> 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
>

As far as I can tell there's a giant elephant in the room and his name is `Tuple`.

The problem is there's a Tuple template in Phobos. If you rename that you get a solid new name for a language tuple.

/mytwocents
July 09, 2015
On Thursday, 9 July 2015 at 19:19:42 UTC, Walter Bright wrote:
> On 7/9/2015 12:56 AM, deadalnix wrote:
>> Several of which actually use linked list for list and probably shouldn't
>> provide random access.
>
> Yes. Consider:
>
>     for (int i = 0; i < list.length; ++i)
>           sum += list[i];
>
> If indexing was allowed on a list, this would seem like perfectly reasonable code.

In many languages that is perfectly reasonable because list does not equal linked list. Its almost as if a list is an abstract concept and does not mean any one definite data structure, hmmm who wuda thunk that...