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: 1094ba,3354bcb01bfd8111 X-Google-Thread: 103376,bda36258b2fe9834 X-Google-Attributes: gid1094ba,gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!newsfeed.stueberl.de!newsr1.ipcore.viaginterkom.de!news-peer1!btnet-feed3!news-peer0-test!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: Martin Dowie Newsgroups: comp.lang.fortran,comp.lang.ada Subject: Re: Shortcut logicals Date: Tue, 1 Feb 2005 06:49:00 +0000 (UTC) Organization: BT Openworld Message-ID: References: <41f94cab$1@news1.ethz.ch> <1107060103.157135.325010@z14g2000cwz.googlegroups.com> <8u2pv0tdd9b1v689rtqc2c2tlm9pn9t1t6@4ax.com> <1107085125.849687.318060@c13g2000cwb.googlegroups.com> <1107096062.786125.100030@f14g2000cwb.googlegroups.com> <10vq094k09igv3c@corp.supernews.com> <1107160100.162171.223490@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: host81-154-188-69.range81-154.btcentralplus.com Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: titan.btinternet.com 1107240540 11676 81.154.188.69 (1 Feb 2005 06:49:00 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Tue, 1 Feb 2005 06:49:00 +0000 (UTC) In-Reply-To: X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0RC1 (Windows/20041201) Xref: g2news1.google.com comp.lang.fortran:10040 comp.lang.ada:8102 Date: 2005-02-01T06:49:00+00:00 List-Id: Robert A Duff wrote: > Sorry, I've no idea what the Fortran rules are. > > In Ada, the above expression is syntactically illegal -- compile time > error. You can write: > > (cond1 and cond2) and then (cond3 and cond4) > > or: > > ((cond1 and cond2) and then cond3) and cond4) > > for example. > > "and" is just a function call. If you say "X and Y" then X and Y are > both evaluated (in either order) and passed to the "and" function. The > predefined version of "and" returns True if both are True. But "and > then" is a short-circuit control form: if you say "X and then Y", X is > evaluated first, and if it's True, you're done. Otherwise (X is False) > Y is evaluated. Bob, For clarity, I think you got the last bits a little wrong... If X is "True" then Y is evaluated otherwise (X is "False"), Y is not evaluated. What you said would be right if it was an "or else" short-circuit form. Cheers -- Martin