Path: utzoo!attcan!uunet!cs.utexas.edu!rutgers!cmcl2!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.c Subject: Re: ambiguous ? Message-ID: <14106@lanl.gov> Date: 23 Oct 89 04:11:36 GMT References: <1989Oct21.071319.8839@utzoo.uucp> Organization: Los Alamos National Laboratory Lines: 26 From article <1989Oct21.071319.8839@utzoo.uucp>, by henry@utzoo.uucp (Henry Spencer): > [...] The whole purpose of && and || is to force > conditional evaluation, and hence evaluation order. No, the effect these operators have on evaluation is only part of their "whole purpose". The also happen to be infix operators which invoke boolean functions of two arguments. The functions are, mathematically, commutative and associative. It is not, necessarily, a good idea for the language to supress these characteristics - you loose a considerable number of opportunities to optimize. Some studies I've seen in the literature recommend that the boolean operators should _not_ force evaluation order. I have no particular opinion on this issue except that I am not satisfied with the loss optimization, but I wouldn't be satisfied without a way to force order either - can't have both (or can you? I know of an experimental language with both). > [...] I have no objection > to operators whose specific purpose is to force order, when they are > broadly useful. [...] It is obviously a completely subjective question about what order forcing syntax is "broadly useful". As I've pointed out numerous times in this discussion, I favor giving the user the option - at least - of explicitly specifying the order of evaluation. The specification of the C standard in such a way that I _cannot_ force explicit evaluation order without sacrificing efficiency and readibility is what I object to.