comp.lang.ada
 help / color / mirror / Atom feed
From: "James Van Buskirk" <not_valid@comcast.net>
Subject: Re: Shortcut logicals (was: Re: F200x )
Date: Mon, 31 Jan 2005 20:49:13 -0700
Date: 2005-01-31T20:49:13-07:00	[thread overview]
Message-ID: <xoKdncGq19cBZ2PcRVn-gg@comcast.com> (raw)
In-Reply-To: ZaCLd.474$xR1.216@bgtnsc04-news.ops.worldnet.att.net

"James Giles" <jamesgiles@worldnet.att.net> wrote in message
news:ZaCLd.474$xR1.216@bgtnsc04-news.ops.worldnet.att.net...

>    x/=0.0 .and. cond2 .andthen. cond3 .and. 5.0/x>10.0

> ?=>

>    5.0/x>10.0 .and. x/=0.0 .and. cond2 .andthen. cond3

>    cond2 .andthen. cond3 .and. 5.0/x>10.0 .and. x/=0.0

Obviously the first short-circuits the DIVCHK and the last two
don't.

> One of the reasons it took me a while to respond is that I *did*
> read what you wrote (and couldn't find the subtle relevance you
> assert) - I've just reread it again.  My puzzlement still remains.
> It does seem to me that the case where all operands are scalar
> ought to be simpler than more exotic possibilities.  And a simple
> IF (or even a scalar logical assignment statement) ought to be
> simpler to discuss that a WHERE construct.

Obviously you don't get it.  How do you know what array gets
passed to sub:

module mymod
   implicit none
   contains
      subroutine sub(x)
         logical, intent(in) :: x(:)

         write(*,*) size(x)
      end subroutine sub

      function f(n)
         integer, intent(in) :: n
         logical f(n)
         integer i

         f = mod(mod((17+(/(i,i=1,n)/))**2,97),2) == 0
      end function f
end module mymod

program test
   use mymod
   implicit none
   integer n
   real x

   write(*,'(a)',advance='no') 'Enter the size of the array:> '
   read(*,*) n
   write(*,'(a)',advance='no') 'Enter a number:> '
   read(*,*) x

   call sub(x/=0 .AND_THEN. n > 0 .AND. f(n))
end program test

So pick apart the first typo you find and tell me you still
don't get it... [sigh].

-- 
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end





  reply	other threads:[~2005-02-01  3:49 UTC|newest]

Thread overview: 19+ 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                                   ` Shortcut logicals Martin Dowie
2005-02-01 13:46                                     ` 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 [this message]
2005-02-01  4:31                                         ` James Giles
2005-02-01  8:49 Christoph Grein
2005-02-01 11:43 ` Martin Krischik
2005-02-01 12:45   ` Adrien Plisson
2005-02-01 14:03     ` Martin Krischik
2005-02-01 14:56       ` Les
2005-02-01 16:57       ` Frank J. Lhota
2005-02-01 17:55       ` Dan Nagle
2005-02-01 18:25         ` James Giles
2005-02-01 13:57   ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox