Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!mikem+ From: mikem+@andrew.cmu.edu (Michael Meyer) Newsgroups: comp.lang.fortran Subject: Re: Is this valid fortran Message-ID:Date: 3 Oct 89 22:03:28 GMT References: Organization: Academic Computing, Carnegie Mellon, Pittsburgh, PA Lines: 35 In-Reply-To: I have received numerous replies about my fortran question, viz. is the following code fragment valid. > complex function fred(x,y) > complex x,y > fred=(10,10) > fred= x*conjg(y) + fred > return > end Thanks to all who replied. Some claim it is NOT (!), but the most convincing arguments claim it is. My prior opinion was that the code was acceptable, and the compiler was broken. I'm now even more convinced of that. Here are two relevant citations from the fortran standard. > Excerpts from mail: 3-Oct-89 Re: Is this valid fortran Randall > Mercer@uxc.cso.u (1388) > From section 15.5.1 of the Fortran 77 Ansi Standard: > During every execution of the external function > this variable [they are referring to the function name] > must become defined and, once defined, may be referenced > or become redefined. > Excerpts from mail: 3-Oct-89 Re: Is this valid fortran Mike > Lipsie@pyrps5.pyram (1352) > Yes. ANSI X3.9-1978 15.5.3 states > Within a function subprogram, the symbolic name of a > function specified by a FUNCTION or ENTRY statement must not > appear in any other nonexecutable statement, except a type- > statement. In an executable statement, such a name may > appear only as a variable.