On Fri, 22 Jul 2011 01:54:23 +0200, Andrei Alexandrescu <[email protected]> wrote:

On 7/21/11 6:44 PM, Simen Kjaeraas wrote:
On Thu, 21 Jul 2011 23:40:08 +0200, bearophile
<[email protected]> wrote:

Nick Sabalausky:

Crazy, nutty, wacky idea...

float (a, b, c) = 0.0;

I'd like some syntax sugar for tuples in D (especially for their
unpacking), that syntax goes against one of the most natural ways to
define tuples. So it's not a good idea.

It is highly unlikely that D will ever adopt that syntax for tuples,
due to the previously much-discussed comma operator (which, while
uncommon, is useful at times). I believe the syntax that came out on
top in earlier discussions was the upended hamburger bun, or banana
syntax:

(| float f, string s |) foo = (| 1.2, "Eh, whut?" |);

Here's a crazy idea:

auto foo = tuple(1.2, "Eh, whut?");

Ooh, shiny. I bet I could implement that in the language as-is.


--
  Simen

Reply via email to