A Discussion of Tuple Syntax

deadalnix deadalnix at gmail.com
Tue Aug 20 20:36:08 PDT 2013


On Tuesday, 20 August 2013 at 18:51:23 UTC, Andrei Alexandrescu 
wrote:
> On 8/19/13 11:39 PM, Timon Gehr wrote:
>> On 08/20/2013 02:18 AM, Andrei Alexandrescu wrote:
>>>
>>> Why would it be necessary to return an object of type 
>>> TypeTuple (i.e.
>>> template tuple)?
>>
>>
>> - Elegance. Eg:
>>
>> auto seq(T...)(T arg){ return arg; }
>>
>> auto fold(alias a,S,R)(S start, R range){ ... }
>>
>>
>> seq(0,[1,2,3]).fold!((a,b)=>a+b);
>
> But this is again a value tuple not a template tuple, no?
>
> Andrei

A value tuple IS a tuple. What we call a tuple here as nothing to 
do with a tuple.


More information about the Digitalmars-d mailing list