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

deadalnix deadalnix at gmail.com
Tue Sep 25 02:56:25 PDT 2012


Le 24/09/2012 17:55, Philippe Sigaud a écrit :
> 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.

And the auto flatten stuff is really weird, and sometime get into the way.


More information about the Digitalmars-d mailing list