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.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 1094ba,3354bcb01bfd8111 X-Google-Thread: 103376,bda36258b2fe9834,start X-Google-Attributes: gid1094ba,gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local1.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 31 Jan 2005 18:50:19 -0600 From: "James Van Buskirk" Newsgroups: comp.lang.fortran,comp.lang.ada 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> Subject: Re: Shortcut logicals (was: Re: F200x ) Date: Mon, 31 Jan 2005 17:56:40 -0700 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1478 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478 Message-ID: NNTP-Posting-Host: 24.8.173.150 X-Trace: sv3-NLNZy1eCshmFfoXLTr2WLKe4JivyYeS4EiJegxV6tBv3y1rnHXCzqy6/XYviDjcOpTW+oF+wqVIq3jc!DIThvpmMEXmUoLuI3RbCNPXR5iyzviZAFFtPJjw9eKMEXoIQey1w0/nRb1XbzpWPQXpjM7VxpA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.22 Xref: g2news1.google.com comp.lang.fortran:10022 comp.lang.ada:8091 Date: 2005-01-31T17:56:40-07:00 List-Id: "James Giles" wrote in message news:mXzLd.100$xR1.94@bgtnsc04-news.ops.worldnet.att.net... > Well, I have the F2003 FCD open right now, in �7.4.3 Masked array > assignment - WHERE. So, perhaps you can point out what part of > it resolves the issue I raised: > cond1 .and. cond2 .andthen. cond3 .and. cond4 > Is COND4 permitted to be evaluated or not? I don't see that > WHERE tells me. It has a concept of "pending control" which > I see can be applied on nested constructs, but in the above > expression, not of the terms actually present are part of any > "pending" condition. Or, are you talking about some other > aspect of WHERE entirely? OK, I have added comp.lang.ada, so hopefully someone there can answer the question about the effect of precedence on your snippet, and also discuss the ergonomics of Ada short- circuiting logical operators, or whatever they call them. I would answer your question above, assuming cond1 .AND. cond2 evaluate to scaler .FALSE._lk to be that it all depends; either cond3 or cond4 or neither or both could be 'short-circuited'. In the f95 standard I see some verbiage to the effect that: "If a nonelemental function reference occurs in the expr or variable of a where-assignment-statement or in a mask-expr, the function is evaluated without any masked control; that is, all of its argument expressions are fully evaluated and the function is fully evaluated. If the result is an array and the reference is not within the argument list of a nonelemental function, elements corresponding to true values in the control mask are selected for use in evaluating the expr, variable, or mask-expr. "If an elemental operation or function reference occurs in the expr or variable of a where-assignment-stmt or in a mask-expr, and is not within the argument list of a nonelemental function reference, the operation is performed or the function is evaluated only for the elements corresopnding to true values of the control mask. "If an array constructor appears in a where-assignment-stmt or in a mask-expr, the array constructor is evaluated without any masked control and then the where-assignment-stmt is executed or the mask-expr is evaluated." For .AND_THEN. and .OR_ELSE., if added to the Fortran language, the language would have to be changed somewhat to make it in terms of evaluating expressions rather than masked assignment. Also there should be something about scalar function references in there as well. I'm not even sure about what the standard thinks in WHERE, if an elemental function reference is used in a scalar context, such as WHERE(cond1) x = f(y)*g(z) given that cond1, x, and g(z) all have the same shape, f is elemental, and y is scalar. Is any(cond1) == .FALSE. then is the standard saying you still have to evaluate f(y) if it's a scalar function but not if it's elemental. This last paragraph shouldn't be considered a well-formed thought. -- write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, & 6.0134700243160014d-154/),(/'x'/)); end