Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: Rearranging FP expressions
Message-ID: <1988Sep27.174613.16697@utzoo.uucp>
Organization: U of Toronto Zoology
References: <4700017@m.cs.uiuc.edu>
Date: Tue, 27 Sep 88 17:46:13 GMT

In article <4700017@m.cs.uiuc.edu> wsmith@m.cs.uiuc.edu writes:
>I realize this topic has been beat to death and its probably too late
>for the ANSI C committee to do anything about it...

Much too late, given that the matter has already been addressed:  expressions
must be evaluated as given unless rearrangement would yield the same results.
("The same" in a programming sense, not just in a mathematical sense.)

>A proposed solution:
>	Expressions enclosed in double parentheses may not be rearranged,
>	all other expressions may be rearranged in "semantically valid" ways.

Doesn't work too well.  The trouble is that extra parentheses are common as
a result of macro expansion.  To do this sort of thing well, you really
need another *kind* of parentheses.  Such schemes have been proposed, but
did not get accepted.
-- 
NASA is into artificial        |     Henry Spencer at U of Toronto Zoology
stupidity.  - Jerry Pournelle  | uunet!attcan!utzoo!henry henry@zoo.toronto.edu