(j3.2006) PURE function vs subroutine
Craig Dedo CAPM
craig
Wed Mar 4 13:16:26 EST 2015
Dan and Everyone Else:
Tom Clune and Bill Long are correct. I was a voting member of J3, now PL22.3,
when we put pure procedures into the language. I remember the debate very clearly. Dick
Hendrickson took the lead on pure procedures.
The point of pure procedures was that they have no side effects. Such
procedures were needed in order to implement the FORALL statement and construct, which was
being put into Fortran at the same time. Thus, the result of a pure function depends
solely on the values of the arguments. Since pure subroutines do not produce results
except through their arguments, it is necessary that the some of the arguments to pure
subroutines need to have either Intent (Out) or Intent (Inout). Also, we needed to have
pure subroutines in order to have defined assignments in FORALL constructs.
Hope this helps.
Please feel free to contact me at any time with any questions or concerns that
you may have. I am looking forward to hearing from you soon.
Sincerely,
Craig T. Dedo, CAPM
17130 W. Burleigh Place
P. O. Box 423 Mobile Phone: (414) 412-5869
Brookfield, WI 53008-0423 E-mail: <craig at ctdedo.com>
USA
Linked-In: http://www.linkedin.com/in/craigdedo
From: j3-bounces at mailman.j3-fortran.org [mailto:j3-bounces at mailman.j3-fortran.org] On
Behalf Of Tom Clune
Sent: Wednesday, March 04, 2015 11:20
To: fortran standards email list for J3
Subject: Re: (j3.2006) PURE function vs subroutine
My understanding is that this is not a technical issue, but rather a statement requiring
pure functions to align with the conventional notion of a mathematical function. I.e.
functions have only one output (the function result), and no "side-effects" on the "input"
parameters.
On Mar 4, 2015, at 12:14 PM, Daniel C Chen <cdchen at ca.ibm.com> wrote:
Hello,
Can someone shed light on why a nonpointer dummy argument of a pure function that is not
VALUE must be INTENT(IN) where such a dummy argument of a pure subroutine can be
INTENT(OUT)/INTENT(INOUT)?
Thanks,
Daniel
XL Fortran Development - IBM Toronto Software Lab
Phone: 905-413-3056
Tie: 969-3056
Email: cdchen at ca.ibm.com
http://www.ibm.com/software/awdtools/fortran/xlfortran
_______________________________________________
J3 mailing list
J3 at mailman.j3-fortran.org
http://mailman.j3-fortran.org/mailman/listinfo/j3
Thomas Clune, Ph. D.
<Thomas.L.Clune at nasa.gov>
Head ASTG,Code 606
NASA GSFC
MS 610.8 B33-C128
Greenbelt, MD 20771
301-286-4635
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20150304/b71ac6c9/attachment.html
More information about the J3
mailing list