ambiguous ?

Jim Giles jlg at lanl.gov
Thu Oct 26 07:49:40 AEST 1989


>From article <2520 at munnari.oz.au>, by ok at cs.mu.oz.au (Richard O'Keefe):
>> >       if (getch(5) && getch(6)) {...}
> In the Fortran equivalent
> 	IF (GETCH(5) .AND. GETCH(6)) ...
> either operand may be evaluated first, and the other may or may not
> be evaluated depending on the outcome and the compiler-writer's choice.
> This is what it _means_ to exploit the mathematical properties of "and"
> as Giles recommends.

This is false, since I haven't _made_ a recommendation on this issue.
It is also false because I wouldn't recommend eliminating the short
circuit behaviour of && and || without also requiring the full evaluation
of all operands that _might_ cause side effects.  In other words, you are
confusing the behaviour of Fortran with the behaviour I _might_ recommend.



More information about the Comp.lang.c mailing list