Order of evaluation vs. sequence points

Jens Mueller jens.k.mueller at gmx.de
Tue Aug 9 01:36:57 PDT 2011


Kagamin wrote:
> Jens Mueller Wrote:
> 
> > I'm having trouble understanding the difference between order of
> > evaluation and sequence points.
> 
> Order of evaluation matters when subexpressions contain sequence points.

Because it moves sequence points around. Right?
Reasoning about the evaluation of expressions with sequence points is
difficult. Because the programmer has to first known all the rules and
second follow them appropriately.
My current definition for illegal expressions is as follows:
An expression is illegal iff it has a side effect that modifies a
variable which is either read or written as part of the expression.

I only see one justification for having this more difficult evaluation
of expressions. That is better performance. I wish I only had a feeling
for it. Because right now it just feels complicated for no reason.

Jens


More information about the Digitalmars-d mailing list