Buy GNU books!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
You can import a module into the current namespace with
'featurename. In either case the names exported by the specified module (class) are added to the current set of visible names.
If modulespec is
<classname> where classname
is an instance module (it has a public default constructor),
and if no module instance for that class
has been registered in the current environment, then a new instance
is created and registered (using a "magic" identifier).
If the module class either inherits from
java.lang.Runnable then the corresponding
method is executed. (This is done after the instance is
registered so that cycles can be handled.) These actions (creating,
registering, and running the module instance) are done both at compile
time and at run time, if necessary.
All the public fields of the module class are then incorporated in the current set of local visible names in the current module. This is done at compile time - no new bindings are created at run-time (except for the magic binding used to register the module instance), and the imported bindings are private to the current module. References to the imported bindings will be compiled as field references, using the module instance (except for static fields).
If the modulespec is
'featurename then the
featurename is looked up (at compile time) in the "feature table"
which yields the implementing
For some examples, you may want to look in the
|webmaster||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|