Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site rabbit.UUCP Path: utzoo!linus!security!genrad!mit-eddie!mit-vax!eagle!allegra!alice!rabbit!ark From: ark@rabbit.UUCP Newsgroups: net.lang.c Subject: Re: Must useless expressions be evaluated? Message-ID: <2076@rabbit.UUCP> Date: Sun, 16-Oct-83 12:33:09 EDT Article-I.D.: rabbit.2076 Posted: Sun Oct 16 12:33:09 1983 Date-Received: Mon, 17-Oct-83 01:56:03 EDT References: <817@mit-eddie.UUCP> Organization: AT&T Bell Laboratories, Murray Hill Lines: 11 Barry Margolin points out that if foo is a reducible function, then the compiler is allowed to generate code for if bool_var | foo(x) then ... which does not evaluate foo if bool_var is true. This statement is correct, but slightly misleading -- the PL/I implementation I have used (and, if I recall correctly, the ANSI standard) permits the compiler to use short-circuit evaluation in this context even if foo is not reducible. In general, the compiler is only obliged to evaluate enough of an expression to determine its result.