anything like C++ references?
timr at probo.com
Sun Jul 20 01:22:49 CEST 2003
"Terry Reedy" <tjreedy at udel.edu> wrote:
>"Stephen Horne" <intentionally at blank.co.uk> wrote in message
>> Anyway, Algol and Fortran apparently (I didn't know this until
>> today) *always* used call-by-reference.
>Not true (about Fortran). I vaguely remember (about 1980) when IBM
>Fortran switched from one calling convention to another.
No, you don't.
A simple variable name is required to be passed by reference (or at least
passed so it SIMULATES pass-by-reference), at least until Fortran90.
Expressions in a parameter list are passed by value, of course, and you
could force the compiler to use call-by-value by using trickery like:
CALL FUNC1( PARAM1, (PARAM2), 1*PARAM3 )
PARAM2 and PARAM3 would usually by passed by value.
I absolutely refuse to believe that IBM would have arbitrarily changed
their Fortran compiler's default calling convention in 1980. The F77
standard simply would not allow it, if you were even using F77; much
Fortran code was still F66 until well into the 1980s.
- Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the Python-list