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?
Waw! auto(name, age) = getTuple(); looks better :)