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 10:46:28 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!sn-xit-01!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 13:50:50 -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> 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:18553 Date: 2002-01-04T13:50:50-05:00 List-Id: "Hyman Rosen" wrote in message news:3C35E733.6030603@mail.com... > In C, you cannot use & and | in the same way that you use > && and ||, because the former accept only integer operands. But you have to know that. How is learning the difference between "&" and "&&" any different from learning the difference between "and" and "and then"? > For example, if you have a pair of pointers, p and q, and > wish to test whether both are not null, you must use p&&q. > If you were to use p&q, the compiler would reject it. This is a specious comparison, because your question was about an expression that compiles using either operator. Suppose you have a pair of integers: how does a programmer learn the difference between if (i & j) and if (i && j) > C++ does have the horrible trap that user-defined && and || > operators don't short-circuit. Expert advice is to never > define these except in the rarest of circumstances. Well if we're talking about having an expert's knowledge then this thread is irrelevant.