let (x,y) = ...
via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Fri Feb 20 02:33:24 PST 2015
On Friday, 20 February 2015 at 09:12:26 UTC, Jacob Carlborg wrote:
> On 2015-02-19 05:38, thedeemon wrote:
>> Creating tuples and returning them from functions is trivial
>> in D:
>>
>> auto getTuple() { return tuple("Bob", 42); }
>>
>> but using them afterwards can be confusing and error prone
>>
>> auto t = getTuple();
>> writeln("name is ", t[0], " age is ", t[1]);
>>
>> I really missed the ML syntax to write
>>
>> let (name, age) = getTuple();
>
> Didn't someone create a pull request for something like:
>
> auto(name, age) = getTuple();
>
> Or was it a DIP?
This one, by Kenji?
http://wiki.dlang.org/DIP32
More information about the Digitalmars-d-announce
mailing list