DIP54 : revamp of Phobos tuple types

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Dec 29 22:45:36 PST 2013


On 12/29/13 8:25 PM, Timon Gehr wrote:
> On 12/30/2013 05:11 AM, Dicebot wrote:
>> On Monday, 30 December 2013 at 04:07:42 UTC, Timon Gehr wrote:
>>>> Template arguments lists are what they are - entities that can be
>>>> passed
>>>> to templates. Aliasing them is sensible but creating values thereof
>>>> does
>>>> not make sense.
>>>
>>> You are doing it in the implementation of std.typecons.Tuple, and on
>>> every variadic function template call. How does it not make sense?
>>
>> See my clarification here -
>> http://forum.dlang.org/post/msumrnieryzifgcyuiqc@forum.dlang.org
>>
>> It is not creation of instance in general language meaning, it is
>> special case implemented specifically for template argument lists which
>> just happen to look so naturally close to instantiation. In fact it
>> creates new template argument lists of aliases to variables, one can do
>> the same trick manually with named variables with exactly same effect.
>
> Just to get your assumption that I am confused out of the way, I am
> fully aware how this is most easily implemented (in fact, I _have_
> implemented it in my own partly-finished D programming language frontend.)
>
> If you are going to claim that this is not proper creation of an
> instance of a type, except that:
>
> int x;
> static assert(is(typeof(x)==int));
>
> Seq!(int, double) y;
> static assert(is(typeof(y)==Seq!(int, double))); // presumably "bad"
>
> Then I don't know what to tell you. It is not useful at all to make a
> terminological distinction between the two cases above and claim that
> one is somehow special and confusing, when everything actually behaves
> in an uniform way.

The latter holds no state though.

Andrei



More information about the Digitalmars-d mailing list