> Sorry to seem so picky about a term, but it is a harmful term
> when misused. It causes buggy code and extra work.
And I'm sorry I used the term so loosely to begin with ;-) If you have
another term that can convey to general programmers the model used by
Fortran, I'll be happy to use it.
On a related issue, I seem to recall that in Fortran 90 the following
code was not guaranteed to work, probably for the same reason. Have I
misinterpreted the standard, and if not, has this state of affairs
changed at all in F95 or F2000?
type A
real blah
end type
subroutine setA( a )
type (A), pointer :: a
type (A), pointer :: b
allocate( b )
a => b
end subroutine
...
type (A), pointer :: a
call setA( a )
! Is 'a' valid here?
In other words, it is valid to pass a pointer to a subroutine, and set
the pointer in the subroutine?
Regards,
Drew
|