From: Martin Dowie <martin.dowie@btopenworld.com>
Subject: Re: Shortcut logicals
Date: Tue, 1 Feb 2005 06:49:00 +0000 (UTC)
Date: 2005-02-01T06:49:00+00:00 [thread overview]
Message-ID: <ctn8os$bcs$1@titan.btinternet.com> (raw)
In-Reply-To: <wcc651dnkpw.fsf@shell01.TheWorld.com>
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
next prev parent reply other threads:[~2005-02-01 6:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <41f94cab$1@news1.ethz.ch>
[not found] ` <INfKd.13707$bh6.378409@weber.videotron.net>
[not found] ` <nospam-6F7AE0.11340228012005@news.supernews.com>
[not found] ` <lqjnv01969glk2mbv1plvjdn5idkb1c3db@4ax.com>
[not found] ` <1107060103.157135.325010@z14g2000cwz.googlegroups.com>
[not found] ` <8u2pv0tdd9b1v689rtqc2c2tlm9pn9t1t6@4ax.com>
[not found] ` <1107085125.849687.318060@c13g2000cwb.googlegroups.com>
[not found] ` <1107096062.786125.100030@f14g2000cwb.googlegroups.com>
[not found] ` <10vq094k09igv3c@corp.supernews.com>
[not found] ` <eudLd.43724$8u5.37685@bgtnsc04-news.ops.worldnet.att.net>
[not found] ` <1107160100.162171.223490@f14g2000cwb.googlegroups.com>
[not found] ` <cTxLd.126318$w62.46060@bgtnsc05-news.ops.worldnet.att.net>
[not found] ` <xfKdnUflrtW3I2PcRVn-og@comcast.com>
[not found] ` <rEzLd.68$xR1.54@bgtnsc04-news.ops.worldnet.att.net>
[not found] ` <ON-dnSQzGfXOVWPcRVn-1A@comcast.com>
[not found] ` <mXzLd.100$xR1.94@bgtnsc04-news.ops.worldnet.att.net>
2005-02-01 0:56 ` Shortcut logicals (was: Re: F200x ) James Van Buskirk
2005-02-01 1:16 ` Robert A Duff
2005-02-01 6:49 ` Martin Dowie [this message]
2005-02-01 13:46 ` Shortcut logicals Robert A Duff
2005-02-01 8:08 ` Shortcut logicals (was: Re: F200x ) Martin Krischik
2005-02-01 1:43 ` James Giles
2005-02-01 2:33 ` James Van Buskirk
2005-02-01 2:53 ` James Giles
2005-02-01 3:49 ` James Van Buskirk
2005-02-01 4:31 ` James Giles
2005-02-01 8:49 Christoph Grein
2005-02-01 11:43 ` Martin Krischik
2005-02-01 13:57 ` Robert A Duff
2005-02-01 15:35 ` Shortcut logicals Jan Vorbrüggen
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox