Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC840302); site boring.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!mcvax!boring!guido From: guido@boring.UUCP Newsgroups: net.lang.c Subject: && evaluation order (Re: C style) Message-ID: <6674@boring.UUCP> Date: Fri, 1-Nov-85 14:31:39 EST Article-I.D.: boring.6674 Posted: Fri Nov 1 14:31:39 1985 Date-Received: Sun, 3-Nov-85 09:29:32 EST References: <259@3comvax.UUCP> <538@ttrdc.UUCP> Reply-To: guido@mcvax.UUCP (Guido van Rossum) Organization: "Stamp Out BASIC" Committee, CWI, Amsterdam Lines: 11 Summary: is GUARANTEED left-to-right Apparently-To: rnews@mcvax.LOCAL In article <538@ttrdc.UUCP> levy@ttrdc.UUCP (Daniel R. Levy) writes: >The && operator >doesn't GUARANTEE the chronological order of evaluation is going to be left >to right, if you have a screwball compiler (though it most probably will be). If your compiler doesn't evaluate && left-to-right (and stop after the first zero result) it isn't implementing C. Maybe you're confusing it with Pascal's AND or C's single & operators, which have to evaluate both operands. So the program fragment you commented on was perfectly legit in using &&. Guido van Rossum, CWI, Amsterdam (guido@mcvax.UUCP)