ambiguous ?

Henry Spencer henry at utzoo.uucp
Sat Oct 21 03:53:52 AEST 1989


In article <14092 at lanl.gov> jlg at lanl.gov (Jim Giles) writes:
>... Unfortunately, there is no way of using
>C efficiently without also using ambiguous features.  (For example, in
>the current discussion, the only way to get a reliable evaluation order
>for the function arguments is to do redundant assignments in previous
>statements.  Most C compilers are _VERY_ bad a optimizing such sequences.)

Gee, I guess I've been using C inefficiently all these years, including in
various bits of work on performance improvement.  Funny that I never realized
it.  Personally, my view is that code which relies on order of evaluation
within expressions -- except in a few well-defined cases like C's && and
|| operators -- is broken even if the language specifies a precise meaning.

>The primary purpose of a programming language is to _unambiguously_
>specify the operation of an algorithm...

If you want specifications, try denotational semantics.  The purpose of
a programming language is to make the algorithm executable.  This always
involves compromises.
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list