Everyone who writes safety critical software should read this

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Nov 2 12:57:31 PDT 2013


On 11/2/13 12:42 PM, bearophile wrote:
> Andrei Alexandrescu:
>
>> We need to ensure left-to-right evaluation semantics through and through.
>
> Good. And Walter agrees with you.

Actually he only agrees partially. In the expression:

a[i++] = i++;

Walter argues "evaluate right-hand side first, then left-hand side, then 
assign". I argue "evaluate left-to-right regardless". I suspect this 
extends to other cases, such as:

functions[i++](i++);

(assuming functions is an array of functions). I argue that LTR is the 
one way to go. Not sure he'd agree. Similarly:

objects[i++].method(i++);

(assuming objects is an array of objects). Here again I think LTR is the 
simplest and most intuitive rule.

> I am not asking for a road map with
> dates, but what are the steps and the work to arrive there? What needs
> to be done?

I think someone should sit down and define behavior for all such cases, 
then proceed and implement it in the front-end. I haven't done 
significant front end work so I don't know what that entails.


Andrei



More information about the Digitalmars-d mailing list