(j3.2006) Finalizing subroutines question
Fri May 23 15:13:11 EDT 2008
On Friday 23 May 2008 11:57, Jim Xia wrote:
> Intrinsic assignment ALWAYS finalizes LHS before assignment happens.
Oh, OK. This seems another rule that says always when it should really say "in
these cases", just like that rule that says one calls a finalizer for an
array of size 1 just because there is a finalizer around that takes an array
of length 10. In that sense, finalizing a co-indexed object (and trying to do
some illegal deallocation inside) is no more or less bad than trying to
finalize the array of length 1. I am not sure if the compiler even needs to
detect there could be a problem.
> That should
> pretty severely limit what the user could put into a FINAL routine and
> still have it callable with a coindexed argument.
Or maybe, we should just say finalization does not occur for the LHS if it is
co-indexed. That way, people can still use finalizers in contexts where they
are appropriate, instead of us saying the finalizer always gets called, even
when it is clearly inappropriate?
More information about the J3