unary +
Henry Spencer
henry at utzoo.UUCP
Tue Mar 18 06:37:21 AEST 1986
> ...if you do care [about order of evaluation] then you should be able
> to specify it using parentheses...
How do you tell order-of-evaluation-forcing parentheses from parentheses
that are there just to get the precedence right? There is no practical
way to write "a*(c+d)" without parentheses (or other annoying kludges).
Yet optimizing this to "a*c + a*d" might well be useful in various
situations. Parentheses already have a role: overriding default operator
binding rules. Asking them to do two things at once would get messy.
> ...I'm very much against optimisers that think they know better than you...
Sometimes they *do* know better than you; that is exactly the point. They
certainly know more than you about how to effectively exploit the underlying
machine. They may well know more than you about the exact nature of the
computation, e.g. if some parts of it are hidden inside macros for the sake
of easy change and portability. And they don't have to worry about the
other constraints, like readability and making sure that a messy formula
really is right, that may limit what you write.
--
Henry Spencer @ U of Toronto Zoology
{allegra,ihnp4,linus,decvax}!utzoo!henry
More information about the Comp.lang.c
mailing list