Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!van-bc!ubc-cs!unixg.ubc.ca!brazeau.ucs.ualberta.ca!alberta!mts.ucs.UAlberta.CA!Al_Dunbar From: userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) Newsgroups: comp.lang.fortran Subject: Re: Questions about IF Message-ID: Date: Sat, 29 Jun 91 15:33:26 GMT Organization: MTS Univ of Alberta References: Lines: 27 In article , JRowe@exua.exeter.ac.uk (John Rowe) writes: >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. > >But can it choose to evaluate: > > If ((expr2.and.expr3) .and. expr1) then > >I didn't see anything that said it couldn't. > Exactly. This does not violate parenthesis. Assuming no side effects, the results of both of the above would be the same. -------------------+------------------------------------------- Al Dunbar | Edmonton, Alberta | Disclaimer: "not much better than CANADA | datclaimer" -------------------+-------------------------------------------