Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@utzoo.uucp (Henry Spencer)
Subject: Re: ambiguous ?
Message-ID: <1989Oct21.071319.8839@utzoo.uucp>
Organization: U of Toronto Zoology
References: <1989Oct20.175352.20598@utzoo.uucp> <14102@lanl.gov>
Date: Sat, 21 Oct 89 07:13:19 GMT

In article <14102@lanl.gov> jlg@lanl.gov (Jim Giles) writes:
>> [...]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.
>
>Gee, isn't it interesting that the only order dependent behaviour you
>are willing to trust are the "well-defined" && and || operators...

Not really.  All it means is that I think C got this particular decision
right.

>...  Presumably, if C
>made argument evaluation in function calls "well-defined", you would
>would have no qualms depending on their order either...

Your presumption is incorrect.  The whole purpose of && and || is to force
conditional evaluation, and hence evaluation order.  I have no objection
to operators whose specific purpose is to force order, when they are
broadly useful.  I do have considerable objection to code that depends
on evaluation order *without* putting the reader on notice of it by
explicitly using forcing operators.
-- 
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
