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-Thread: 103376,99e73f65ea2533b9 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!feeder.erje.net!news.ecp.fr!u-picardie.fr!proxad.net!feeder1-2.proxad.net!cleanfeed3-a.proxad.net!nnrp20-1.free.fr!not-for-mail From: Samuel Tardieu Newsgroups: comp.lang.ada Subject: Re: and then... (a curiosity) References: <18b41828-bda4-4484-8884-ad62ce1c831d@f36g2000hsa.googlegroups.com> Date: Fri, 29 Aug 2008 23:47:25 +0200 Message-ID: <874p53bij6.fsf@willow.rfc1149.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:T8qptuE1U5vtMALXTt8hNkyHGBI= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Leafnode-NNTP-Posting-Host: 2a01:e35:1382:f950::3 Organization: Guest of ProXad - France NNTP-Posting-Date: 29 Aug 2008 23:50:02 MEST NNTP-Posting-Host: 88.191.14.223 X-Trace: 1220046602 news-2.free.fr 23864 88.191.14.223:49231 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:7552 Date: 2008-08-29T23:50:02+02:00 List-Id: > I wondered why in Ada the "shortcut and" is "and then", while the > simple "and" has not a shortcut behaviour. My curiosity stems from > the fact that I am not able to envision any situation where the "non > shortcut" version would preferable, but I immagine that there was > some reason for this choice. Do anyone have any hint? Sometimes, you want to ensure that both sides of the boolean operator have been evaluated. Here is an example: -- Send the message to the log and return True if it -- has been logged at least at one place succesfully. function Log (Message : String) return Boolean is begin return Log_To_Network (Message) or Log_To_Disk (Message); end Log; Sam -- Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/