Evaluation order of index expressions

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Mon May 25 17:51:21 PDT 2015


On Monday, 25 May 2015 at 23:44:57 UTC, Andrei Alexandrescu wrote:
> On 5/25/15 11:58 AM, Daniel Murphy wrote:
>> "Andrei Alexandrescu"  wrote in message
>> news:mjvlv5$vch$1 at digitalmars.com...
>>
>>> > which one is correct?
>>>
>>> GDC. -- Andrei
>>
>> I don't think it matters too much if we pick strict LTR, or 
>> keep dmd's
>> existing exception for assign expressions.  IIRC Walter is in 
>> favour of
>> keeping the exception[1].
>>
>> Could you and Walter please come to an agreement and confirm 
>> here?  It
>> should be fairly straightforward to get this fixed once it's 
>> clear which
>> way it should go.
>>
>> [1]
>> https://github.com/D-Programming-Language/dmd/pull/4035#issuecomment-58861231
>
> I'm fine with RTL for assignment expressions, and LTR 
> everywhere else. Daniel, if you could work this out at front 
> end level so it goes the same way for all backends, that would 
> be fantastic. -- Andrei

It seems to me that

a += b - c;

should always be the same as

a.opOpAssign!"+"(b - c);

because otherwise it's just totally confusing.


More information about the Digitalmars-d mailing list