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 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 5 Jan 93 21:08:56 GMT From: alex@MIMSY.CS.UMD.EDU (Alex Blakemore) Subject: Re: Mixing logical operators Message-ID: <63166@mimsy.umd.edu> List-Id: In article <1993Jan5.180216.7426@fcom.cc.utah.edu> swillden@news.ccutah.edu (Sh awn Willden) writes: > if i=5 and j=2 or k=3 then > the VAX Ada compiler complains that logical operators cannot be intermixed. > Is the VAX compiler wrong? The VAX compiler is correct, as usual. Parenthesis are required when different logical operators appear in the same expression. The LRM expresses this as a BNF rule (see 4.4(2)), but its also illustrated in the last two examples in 4.4(6). Its not such a bad rule. The extra parenthesis will help others read your code, but I'm glad they didnt extend the idea to arithmetic operators (where the precedence conventions are well established). -- --------------------------------------------------- Alex Blakemore alex@cs.umd.edu NeXT mail accepted