[MOD] Question about Namespace

Henrik Gedenryd h.gedenryd at open.ac.uk
Tue Feb 5 11:43:40 UTC 2002


Bergel Alexandre wrote:

> Hello Henrik and all,
> 
> Every module use a personal namespace. Good.
> How a namespace can be imported ? And how it can be acceded from outside ?

Sorry for taking so long to answer. Use the messages in the Module category
'module definition protocol'. Typically you use

    <module> externalModule: moduleOrPath alias: aStringOrNil version:
versionOrNil importNames: shouldImport

so:

    <module> externalModule: moduleOrPath alias: nil version: nil
importNames: false

is the typical message.

Currently there are lots of exceptions to the "real" scheme (aka "strong"
modularity) in place to allow old code to work, these exceptions are known
as "weak" modularity.

It was a bug in this compatibility code that made pool vars appear
everywhere.

> Also perhaps it could be a good idea to offer the possibility for a module to
> not be exportable.

Maybe but how would you then be able to use the module at all :-)

> Also, where such mechanisms are involved ?

Not sure I understand what you mean. The above message gives you a
ModuleReference in return (after adding it to the receiver). MRs and
subclasses are also the mechanism for specifying and bringing in undefined
modules so there is some extra stuff in that class.

Henrik




More information about the Squeak-dev mailing list