RFC: Plan to implement FINAL (with polymorphism)

Salvatore Filippone salvatore.filippone@uniroma2.it
Mon Sep 13 12:00:00 GMT 2010


>* I have the impression that we need to generate destructor functions
>for each possible rank, not only those that are actually used --
>because we do not know in advance all places where a type currently
>compiled may be used. Or can we avoid this?

Not necessarily, since the FINAL procedure can be elemental. 
According to the F2003 handbook, sec. 4.4.11.3 (I believe matches the
standard) if an array is involved, then either there is a final that
matches the rank, or there is an elemental one. The rank-matching
routine has precedence over the elemental.
Thus, a sensible default is to have an elemental first, then add special
cases if/when neede; I would expect most user codes to be structured
this way.

Hope this helps
Salvatore 




More information about the Fortran mailing list