let (x,y) = ...

Jacob Carlborg via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Feb 20 01:12:26 PST 2015


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?

-- 
/Jacob Carlborg


More information about the Digitalmars-d-announce mailing list