Tuple DIP

ixid nuaccount at gmail.com
Mon Jun 3 16:33:09 UTC 2019


On Wednesday, 19 September 2018 at 21:48:40 UTC, Timon Gehr wrote:
> So do I, but I need to get a quiet weekend or so to finish this.
>
>> I am very tempted to start my own dip on this and finish it.
>
> Here's the current state of my implementation in DMD:
> https://github.com/dlang/dmd/compare/master...tgehr:tuple-syntax
>
> It has no tests yet, but basically, with those changes, you can 
> write tuple literals `(1, 2.0, "3")`, you can unpack tuples 
> using `auto (a, b) = t;` or `(int a, string b) = t;`, and 
> tuples can be expanded using alias this on function calls, so 
> you can now write things like 
> `zip([1,2,3],[4,5,6]).map!((a,b)=>a+b)`.
>
> The implementation is still missing built-in syntax for tuple 
> types, tuple assignments, and tuple unpacking within function 
> argument lists and foreach loops.

Hey Timon, any progress on this? I've been excitedly wanting this 
tuple syntax since your DIP.


More information about the Digitalmars-d mailing list