Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!gem.mps.ohio-state.edu!usc!apple!rutgers!cmcl2!lanl!jlg From: jlg@lanl.gov (Jim Giles) Newsgroups: comp.lang.c Subject: Re: ambiguous ? Message-ID: <14123@lanl.gov> Date: 25 Oct 89 21:49:40 GMT References: <2520@munnari.oz.au> Organization: Los Alamos National Laboratory Lines: 14 From article <2520@munnari.oz.au>, by ok@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.