Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!lamaster
From: lamaster@ames.arc.nasa.gov (Hugh LaMaster)
Newsgroups: comp.lang.fortran
Subject: Re: Side Effects of FORTRAN Functions
Message-ID: <15436@ames.arc.nasa.gov>
Date: 24 Sep 88 17:55:23 GMT
References: <50500076@uxe.cso.uiuc.edu>
Reply-To: lamaster@ames.arc.nasa.gov.UUCP (Hugh LaMaster)
Organization: NASA Ames Research Center, Moffett Field, Calif.
Lines: 27

In article <50500076@uxe.cso.uiuc.edu> hirchert@uxe.cso.uiuc.edu writes:
:
>Misinformation and misinterpretations on the subject of side effects in FORTRAN
>abound.  I will attempt to throw some light on the subject.  Let me point out
:
>  a standard-conforming FORTRAN program may include functions which have side
>  effects, but the program is prohibited from referencing the results of those
>  side effects.
>
>
>
>
The random number generator is the usual example of something that produces
different results depending on which call it is.  If I understand the
description properly, it is now prohibited to implement a random number
generator as a function: it should be a subroutine.  Is this correct?
(I don't have a problem with it- other than all those old codes which use
x=ranf(i) :-)   ).




-- 
  Hugh LaMaster, m/s 233-9,  UUCP ames!lamaster
  NASA Ames Research Center  ARPA lamaster@ames.arc.nasa.gov
  Moffett Field, CA 94035     
  Phone:  (415)694-6117