Clicky

Fortran Wiki
Inheritance control for CONTAINed procedures

CONTAINed procedures should be able to require explicit declarations for inheritance of host-associated variables. The rationale is that it provides the same benefits of “IMPLICIT NONE” and “USE, ONLY:”. Currently, it is easy to accidentally corrupt a host-associated variable.

I discussed this on comp.lang.fortran, and there was definitely interest in supporting this. The problem comes with how to define the syntax. Using IMPORT is an obvious choice, but how are all of the default inheritances disabled? Default inheritances off simply by having one or more IMPORT statements. However, IMPORT with no variable list means “import all”, so there should also be an “IMPORT NONE” statement.