Module name scoping rules
Last updated at 5:09 pm UTC on 16 January 2006
There are three module name scoping schemes:
This is the eventual goal–a "fully" modular scheme.
- Here, modules must expliclty declare all other modules that they depend on, to be able to refer to names defined in them.
- Moreover, unless a module imports a certain module it depends on, it must qualify any reference to a name defined by that module. (Cf. How to reference names defined in other modules.)
To relax these requirements while the image transitions to full modularity, there are two transitional schemes.:
Rule 2 above does not apply: Code does not need to fully qualify references to names defined in other modules. In effect, all modules that a module depends on are treated as being imported.
Neither rule 1 or 2 above apply. A module does not have to declare dependencies to modules under #(Squeak), i.e. those modules that are part of the standard image.
- The lenient scheme is roughly equivalent to the old pre-modules name scoping rules. This must be used until the image has been refactored to the point where all modules in the standard image have defined their dependencies.