Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!mailrus!purdue!i.cc.purdue.edu!h.cc.purdue.edu!ags From: ags@h.cc.purdue.edu (Dave Seaman) Newsgroups: comp.lang.fortran Subject: Re: Side effects in functions - the special case Message-ID: <4002@h.cc.purdue.edu> Date: 22 Sep 88 15:45:46 GMT References: <3979@lanl.gov> Reply-To: ags@h.cc.purdue.edu.UUCP (Dave Seaman) Organization: Purdue University Lines: 21 In article <3979@lanl.gov> jlg@lanl.gov (Jim Giles) writes: >By the way, I've found the passage in Fortran that allows the following >expression optimization: > A = F(I) + F(I) >is the same as: > tmp = F(I) > A = 2*tmp [Quotes rule on expression evaluation]. That is true, but in Fortran (unlike C), assignment is a statement, not an expression. Therefore the rule you quoted does not apply to A(INVERT(I)) = A(INVERT(I)) + 1 -- Dave Seaman ags@j.cc.purdue.edu