Expression sequencing query

Henry Spencer henry at utzoo.UUCP
Fri Oct 10 06:55:15 AEST 1986


> ... I still believe that it is a pity that C (even Ansi C) does not even
> let the programmer tell it what order is desired by the use
> of parentheses! ...

The problem, as has been mentioned before, is that parentheses are also
used to override the precedence rules for operators.  This is a use in
which one does *not* necessarily want to imply the forcing of evaluation
order.  There really is no entirely satisfactory solution except to use
two different constructs for the two different roles.  C opted long ago
to use parentheses for precedence overrides, and to require explicit
assignment to a temporary to force order of evaluation.  X3J11 has actually
added a few hooks for order control, but changing the meaning of parentheses
for that purpose wasn't considered wise.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,decvax,pyramid}!utzoo!henry



More information about the Comp.lang.c mailing list