Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: ambiguous ?
Message-ID: <1989Oct20.175352.20598@utzoo.uucp>
Organization: U of Toronto Zoology
References: <1989Oct19.022327.6730@utzoo.uucp> <14092@lanl.gov>
Date: Fri, 20 Oct 89 17:53:52 GMT

In article <14092@lanl.gov> jlg@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@zoo.toronto.edu
