(j3.2006) Finalizing subroutines question

Jim Xia jimxia
Fri May 23 15:13:50 EDT 2008

j3-bounces at j3-fortran.org wrote on 05/23/2008 03:02:41 PM:

> Aleksandar Donev wrote:
> > On Friday 23 May 2008 11:19, Jim Xia wrote:
> > 
> >> But how do you finalize this
> >>
> >> obj[i] = local_obj
> >>
> >> obj[i] will get finalized, right?
> >> 
> > No. Finalization occurs during intrinsic assignment only when 
> deallocation is 
> > involved. 
> Really?  I thought it was only when the type of the variable has a final 

> routine specified.  f03:[59:33-34].
> We put in words to exempt coindex object components from automatic 
> reallocation, since allocating/deallocating memory on a different image 
> is not allowed.  In a subroutine you are not allowed to alter the 
> pointer association status or allocation status of a component of a 
> dummy that corresponds to a coindexed actual argument.   That should 
> pretty severely limit what the user could put into a FINAL routine and 
> still have it callable with a coindexed argument.
> I suspect that when users realize what an enormous hammer FINAL routines 

> are, they will just not specify them.

Can we get this written down in the standard F08 that finalizations won't 
happen for coindexed objects?  I'd rather have standard forbid it 
explicitly than let user bleed on it.  I'm really scared of this hammer.

An alternative is to have cofinalizer for the sake of finalization, but I 
feel I'm pretty much along on this proposal :-)


Jim Xia

RL Fortran Compiler Test
IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
Phone (905) 413-3444  Tie-line 313-3444
email: jimxia at ca.ibm.com
D2/YF7/8200 /MKM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://j3-fortran.org/pipermail/j3/attachments/20080523/5fce8aa2/attachment.html 

More information about the J3 mailing list