Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool.mu.edu!news.cs.indiana.edu!nstn.ns.ca!cs.dal.ca!silvert From: silvert@cs.dal.ca (Bill Silvert) Newsgroups: comp.lang.fortran Subject: Re: Questions about IF Message-ID: <1991Jun25.124806.15349@cs.dal.ca> Date: 25 Jun 91 12:48:06 GMT References: <1991Jun24.213601.11329@milton.u.washington.edu> <26384@lanl.gov> Sender: silvert@cs.dal.ca.UUCP (Bill Silvert) Reply-To: silvert%biome@cs.dal.ca Organization: Habitat Ecology Div., Bedford Inst. of Oceanography Lines: 20 In article <26384@lanl.gov> jlg@cochiti.lanl.gov (Jim Giles) writes: >Actually, the standard does require that no optimization >violate parenthesis. So you can force the order of >evaluation any way you want: > > If (expr1 .and. (expr2.and.expr3)) then > ... > >This does the second '.and.' first. The other question was about >short-circuiting: the standard _allows_ short-circuiting but does >not _require_ it. Sorry, this doesn't make sense to me. All the parentheses guarantee is that expr1 will not be evaluated second. Both the sequences 1-2-3 and 3-2-1 are consistent with the given parentheses. -- William Silvert, Habitat Ecology Division, Bedford Inst. of Oceanography P. O. Box 1006, Dartmouth, Nova Scotia, CANADA B2Y 4A2. Tel. (902)426-1577 UUCP=..!{uunet|watmath}!dalcs!biome!silvert BITNET=silvert%biome%dalcs@dalac InterNet=silvert%biome@cs.dal.ca