Replacing the comma operator

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jul 29 09:34:38 PDT 2009


Stewart Gordon wrote:
> Andrei Alexandrescu wrote:
> <snip>
>> No, sorry. Usually I strive to be precise, but this time I just 
>> wasn't. The plan is to define order of evaluation to be lexical order. 
>> Somehow I can't convince Walter that that means assignment too!
> <snip>
> 
> I still would like to know where you found that plan!
> 
> The decision to leave order of evaluation unspecified was a deliberate 
> one at the time, and for good reasons.
> 
> One of these reasons was to open the option of evaluating subexpressions 
> in parallel.  I'm not sure what the others were, but another 
> optimisation potential that comes to my mind is to minimise the working 
> memory while still allowing expressions to be written in an intuitive 
> order.
> 
> Who has decided that these reasons are no longer good, and why?

This has been a source of long discussion in C++ circles, and Walter and 
I have also discussed the matter several times. Defining order of 
evaluation has good benefits, and the loss in efficiency has with time 
been reduced to just a few corner cases that don't seem to justify the 
cost anymore. Note that operations can still be evaluated in parallel as 
long as there's no dependencies between them.

Andrei



More information about the Digitalmars-d mailing list