uniform tuple syntax

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Tue Mar 24 21:13:02 PDT 2015


On 3/24/15 8:00 PM, Rikki Cattermole wrote:
> On 25/03/2015 7:11 a.m., Martin Nowak wrote:
>> On 03/24/2015 03:11 PM, Vlad Levenfeld wrote:
>>> Anything going on with this? Been looking forward to seeing it for
>>> awhile.
>>
>> I think we should settle on a syntax and split DIP32 in a tuple part and
>> a pattern matching part.
>> The proposal wasn't yet formally accepted, partly because we wanted to
>> wait, whether more needs come up. By now it's already 2 years old and it
>> still looks complete IMO.
>>
>> http://wiki.dlang.org/DIP32
>
> There is one thing blatantly missing atleast to me.
> Unpacking into function arguments.
>
> void myfunc(int x, string y) {
>      // ...
> }
>
> myfunc({1, "hi!"}.unpack);

myfunc(tuple(1, "hi!").expand);

Andrei



More information about the Digitalmars-d mailing list