DIP19: Remove comma operator from D and provision better syntactic support for tuples

Philippe Sigaud philippe.sigaud at gmail.com
Mon Sep 24 08:55:24 PDT 2012


On Mon, Sep 24, 2012 at 5:24 PM, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
>
> I think my main problem with this is that I'm perfectly happy with the
> baseline, which has "tuple(" as the left delimiter and ")" as the right
> delimiter.

I found it a bit long compared to other languages in the beginning,
but I've been using them heavily since you added them to Phobos and
I'm now quite happy with them. I even like the .expand thingy.


(I have a few nitpicks, about std.typecons.tuple, but those would be
the subject of another thread)


> I'd be more excited to invent notation if there was overwhelming
> or at least considerable evidence that the notation considerably helps
> certain use cases, or is very frequent. As things are, I'd be quite "meh"
> about suddenly adding lenses.

OK.

One standard use for tuples is assignment:

a,b = someTuple;  // a and b already exist in this scope
auto (c,d) = someTuple; // creates c and d

and similar variations, which Phobos' tuples do not provide.


More information about the Digitalmars-d mailing list