On 03/29/2013 02:17 PM, Simen Kjærås wrote:
On Fri, 29 Mar 2013 13:56:08 +0100, bearophile
<[email protected]> wrote:

One handy tuple syntax in Haskell allows you to name both the items of
a tuple and it whole:


void foo(t2@{int a, string b}) {
    // here a and b are tuple items and t2 is the whole tuple.
}
auto t1@{x, y} = {10, "hi"};
foo(t1);

I suggest instead this syntax:

auto {x, y} t1 = {10, "hi"};

It's closer to regular D syntax.
...

It is already taken and equivalent to:

{x, y} t1 = {10, "hi"};

Reply via email to