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: 7 Apr 93 22:58:57 GMT From: agate!dog.ee.lbl.gov!network.ucsd.edu!ogicse!verdix!mark@ucbvax.Berkeley. EDU (Mark Lundquist) Subject: Re: and then Message-ID: <9560@verdix.verdix.com> List-Id: In article <1993Apr7.173556.17184@sei.cmu.edu> ae@sei.cmu.edu (Arthur Evans) wr ites: >In connection with a discussion of Ada's short-circuit control forms, >sampson@nosc.mil (Charles H. Sampson) says Ada compiler writers appear to have abdicated their responsibility and make no attempt to determine when boolean operations can be optimized as short-circuit. Well, I'm not surprised that they make no such attempt, but it's not because they have abdicated any responsibility. ARM 4.5(5) says of expressions involving 'and' and 'or': The operands ... are evaluated in some order that is not defined by the language (but before application of the corresponding operator). In other words, both operands MUST be evaluated. That requirement is not unreasonable given the availability of the short-circuit forms. > I don't think it means anything MUST be evaluated. If you write if TRUE and TRUE then do_something; end if; are you saying the RM says that code must be generated to evaluate the operands and apply the operator? The RM is not talking about implementation, it is specifying the *logical* semantics of these operators.