From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,MSGID_SHORT autolearn=no autolearn_force=no version=3.4.5-pre1 Date: 10 Apr 93 15:36:50 GMT From: mcsun!sun4nl!cwi.nl!dik@uunet.uu.net (Dik T. Winter) Subject: Re: and then Message-ID: <9550@charon.cwi.nl> List-Id: In article <1q3vtq$2lt@travis.csd.harris.com> danr@ada1.ssd.csd.harris.com (Dan Rittersdorf) writes: > In article <1993Apr7.162133.3564@nosc.mil> sampson@nosc.mil (Charles H. Samp son) writes: ... > > In addition, there > >are cases when it is unreasonable to expect such an optimization; when the > >second operand contains a function reference, for example. There are other possibilities. Short-circuiting may make the program actually slower (jumps take time and sometimes a lot). > > > I find it odd, though, that you feel a vendor has some *responsibility * > to provide this optimization. There is of course no such *responsibility*, it is merely a question of quality. Especially as I prefer conditional tests in non-short-circuited form if it does not matter. In that case a good compiler would find what is most efficient, short-circuiting or not. Short-circuiting should only be used where it matters for the logic of the program (e.g. the second operand becomes invalid). -- dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland home: bovenover 215, 1025 jn amsterdam, nederland; e-mail: dik@cwi.nl