I am a little bit puzzled on the INTENT
statement of Fortran. I will use a C++-like language to better understand your answers and better express myself.
As far as I understand, there are three possible statements:
INTENT(IN)
specifies a constantINTENT(OUT)
specifies a referenceINTENT(INOUT)
specifies a local copy which will be copied back
What is the need for distinguishing the last two, OUT
and INOUT
? Is there some historical limitation that lead to this design?
To clarify: I am not interested in the differences as declared by the standard per se, I need a historical perspective on the introduction of INTENT
: why and when, basically.
Thanks & Cheers!