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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Sep 24 06:58:57 PDT 2012


On 9/24/12 8:18 AM, Timon Gehr wrote:
> On 09/24/2012 05:25 AM, Andrei Alexandrescu wrote:
>> On 9/23/12 9:31 PM, deadalnix wrote:
>>> Le 24/09/2012 03:14, Andrei Alexandrescu a écrit :
>>>> On 9/23/12 7:20 PM, Adam D. Ruppe wrote:
>>>>> On Sunday, 23 September 2012 at 22:55:33 UTC, Timon Gehr wrote:
>>>>>> I believe it is currently left-to-right for D, in all kinds of
>>>>>> expressions, but DMD does not implement it yet.
>>>>>
>>>>> Yeah, I thought it was already defined.
>>>>
>>>> Actually it's right to left for assignments. In expr1 = expr2, expr2
>>>> gets evaluated first.
>>>>
>>>> Andrei
>>>
>>> Is it by implementation or by design ?
>>
>> Currently probably neither :o). I used to oppose it, then I figured it's
>> actually nice because of things like:
>>
>> int[int] stuff;
>> stuff[42] = stuff.length;
>>
>>
>> Andrei
>
> So you are arguing for computing the arguments for a method call before
> the receiver is computed? (What about UFCS?) Or should opAssign behave
> specially?

Ha, good point about opAssign! Probably we should go with left-to-right 
everywhere, including in assignment.

Andrei


More information about the Digitalmars-d mailing list