(j3.2006) does move_alloc violate restrictions in 188.8.131.52?
Wed Oct 28 20:17:28 EDT 2009
Jim Xia wrote:
> CALL MOVE_ALLOC (FROM, TO)
> The fact is there is only ONE actual argument survives the call.
That is the opposite of a fact. Both FROM and TO are allocatables, and they
> BUT, during the execution of MOVE_ALLOC, it has to be associated with both
> FROM and TO.
Not so. There are two actual arguments. They are allocatable objects. They
both have their allocation status changed by execution of the intrinsic.
Complaints that MOVE_ALLOC does something that cannot otherwise be programmed in
Fortran are somewhat missing the point of several of the intrinsic functions!
Jim also writes:
> Nice shelter by "not written in Fortran". So assume foo is written in C, then
> "call foo(a, a)" is perfectly legal by this definition even though you know
> foo assigns 1 to its first argument, 2 to the 2nd? -- sigh
Yes, it is absolutely valid. C specifies the semantics of what happens in that
case. If you don't want that to be valid, or don't want those semantics, then
don't write FOO in C.
................................Malcolm Cohen, Nihon NAG, Tokyo.
More information about the J3