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 02:52:32 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!128.230.129.106!news.maxwell.syr.edu!dispose.news.demon.net!demon!btnet-peer0!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: "Nick Williams" Newsgroups: comp.lang.ada Subject: Re: A case where Ada defaults to unsafe? Date: Thu, 3 Jan 2002 23:38:45 +0000 (UTC) Organization: BT Openworld Message-ID: References: <3C34BF2C.6030500@mail.com> <3C34D252.4070307@mail.com> <3C34E43E.5070906@mail.com> NNTP-Posting-Host: host62-7-115-133.btinternet.com X-Trace: paris.btinternet.com 1010101125 24944 62.7.115.133 (3 Jan 2002 23:38:45 GMT) X-Complaints-To: usenet@paris.btinternet.com NNTP-Posting-Date: Thu, 3 Jan 2002 23:38:45 +0000 (UTC) X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Xref: archiver1.google.com comp.lang.ada:18510 Date: 2002-01-03T23:38:45+00:00 List-Id: "Hyman Rosen" wrote in message news:3C34E43E.5070906@mail.com... > >>But get away from C/C++ for a moment. In pure Ada terms, isn't it less safe > >>for the defaults to be "and" and "or" instead of "and then" and "or else"? > > Perhaps for ex-C programmers it is. But that's certianly not the only pitfall in > > the language for ex-C programmers. > > If you were instead brought up to believe that boolean "and" is communitive, > > like they teach in math/logic classes, then it makes perfect sense. In that > > case, "and then" is just a nice shorthand for " then if ... then". > You haven't answered my question, though. Isn't the commutative semantic > less safe than the short circuit one? It's 'unsafe' to the extent that someone who is badly informed, or who expects Ada to behave the same way as C, might use it unsafely: you might as well say signed integer types are unsafe. You ask the question in 'pure Ada terms', but in 'pure Ada terms' they're just as safe as each other: a 'pure Ada' programmer would have no baggage in terms of preconceived expectation of short-circuiting behaviour from boolean operators. Cheers, Nick.