On Sat, Jan 27, 2007 at 06:18:50PM +0000, Nicholas Clark wrote:
> Is it defined that $a + $b evaluates the arguments in any particular order?
> Even guaranteeing that either the left or the right gets completely evaluated
> first would be better than C :-)

In C, that is deliberately left undefined to allow the code
generator to have more flexibility in optimizing the code
it generates.  It's always easy to separate side-effects into
multiple statements that are executed in the desired order
if you need a specific order.  If everything in the language
implies a specific order, no opportunity for optimization
remains - even if there is no actual necessity for the
particular order to be followed.

-- 

Reply via email to