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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable 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 04:42:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!peer1-sjc1.usenetserver.com!usenetserver.com!hub1.nntpserver.com!newsfeed01.sul.t-online.de!t-online.de!fr.clara.net!heighliner.fr.clara.net!freenix!enst!enst.fr!not-for-mail From: "M. A. Alves" Newsgroups: comp.lang.ada Subject: Re: A case where Ada defaults to unsafe? Date: Fri, 4 Jan 2002 12:41:54 +0000 (GMT) Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: avanie.enst.fr 1010148122 96406 137.194.161.2 (4 Jan 2002 12:42:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Fri, 4 Jan 2002 12:42:02 +0000 (UTC) To: Return-Path: X-X-Sender: In-Reply-To: <3C35675D.276C2D81@canal-plus.fr> Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:18515 Date: 2002-01-04T12:41:54+00:00 On Fri, 4 Jan 2002, Thierry Lelegard wrote: > . . . > > If have been using Ada for 16 years and I have never understood why there > are two formats. Let's assume that "and then" never existed and that "and" > was defined as short-circuit (same for "or" and "or else"). Wouldn't it > be better (safer) for everyone? I came to Ada 95 from C and this was one of the things of Ada that pleased me a lot. I find N /= 0 and then X / N perfectly clear. And there are in fact cases when you _cannot_ short-circuit viz. when you need to evaluate both expressions e.g. because there produce required effects. In C you must either evaluate the expression previously into a variable (then test the variable) or use the bitwise operator. Any option is not without problems, and of inferior quality to the Ada idiom. Just my 2 cents, -- , M A R I O data miner, LIACC, room 221 tel 351+226078830, ext 121 A M A D O Rua Campo Alegre, 823 fax 351+226003654 A L V E S P-4150-180 PORTO, Portugal mob 351+939354002