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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1094ba,ddafdc033e838b1d X-Google-Thread: 103376,cd51fe79965e9795 X-Google-Attributes: gid1094ba,gid103376,public Path: g2news1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!news.uunet.ca!nf3.bellglobal.com!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail From: "Warren W. Gay VE3WWG" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.fortran,comp.lang.ada Subject: Re: Order of logical operations References: <40C0208A.80DBE53A@wldelft.nl> <2ic6o2Flfo94U1@uni-berlin.de> In-Reply-To: <2ic6o2Flfo94U1@uni-berlin.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 07 Jun 2004 13:00:20 -0400 NNTP-Posting-Host: 198.96.223.163 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1086627555 198.96.223.163 (Mon, 07 Jun 2004 12:59:15 EDT) NNTP-Posting-Date: Mon, 07 Jun 2004 12:59:15 EDT Organization: Bell Sympatico Xref: g2news1.google.com comp.lang.fortran:1736 comp.lang.ada:1201 Date: 2004-06-07T13:00:20-04:00 List-Id: Nick Roberts wrote: > "Ed Falis" wrote in message > news:opr8255wqr5afhvo@garuda.mshome.net... >>On Fri, 04 Jun 2004 18:40:53 GMT, James Van Buskirk >> >>>I am curious >>>as to how useful short-circuiting logical operators are >>>considered to be in languages such as Ada that have both >>>short-circuiting and non-short-circuiting operators. >> >>The short-circuit forms in Ada are considered to be very >>useful for structural analysis of code during safety >>certification (multiple condition, multiple decision analysis). >>This is because sequentialization of the conditions reduces >>the number of tests that would be necessary compared to >>the simultaneous forms, where all combinations of >>conditions would need to be exercised. >> >>Aside from that, I personally don't have a strong feeling >>about the relative merits, excepting some potential >>performance gains. > > > Surely it's quite handy to be able to write things like the following? > > A: array (1..10) of Boolean; > ... > while i > 0 and then A(i) loop > ... I find it handy for access types (for the FORTRAN folks, the use of pointers): if P /= null and then P.Member <= 23 then ... If this were not short-circuited the P.Member access would be problematic when P was null. -- Warren W. Gay VE3WWG http://home.cogeco.ca/~ve3wwg