From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,25aa3c7e1b59f7b5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-04 12:04:01 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: A case where Ada defaults to unsafe? Date: Fri, 4 Jan 2002 15:08:25 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3C34BF2C.6030500@mail.com> <3C34D252.4070307@mail.com> <5ee5b646.0201040829.18db8001@posting.google.com> <3C35E733.6030603@mail.com> <3C35FE2A.9020802@mail.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:18558 Date: 2002-01-04T15:08:25-05:00 List-Id: "Hyman Rosen" wrote in message news:3C35FE2A.9020802@mail.com... > "&" does integer bit combinations, while "&&" does a boolean > conjunction on (lhs != 0) and (rhs != 0), short-circuiting as > needed. The operations are totally different. The operations are totally different because you learned that they are totally different. > On the other hand, "and" and "and then" perform the same logical > operation. No, they do not. "and then" is a short circuit operator. > To use "and", the programmer must make a decision that > the order of evaluation of the operands doesn't matter. When order of evaluation is significant, the Ada designers decided that a special syntax is called for. > If he is > wrong, he has introduced a subtle bug. If he is right, he has > gained nothing over using "and then". There are many ways to have a subtle bug. Just think of all the operator precedence headaches in C; see below. http://www.lysator.liu.se/c/dmr-on-or.html#main Of all the problems I've had in Ada, getting short-circuit evaluation wrong is waaayyyy at the bottom of the list...