something akin to Java's "package" in libraries

Simon Marlow simonmar@microsoft.com
Tue, 5 Mar 2002 14:59:17 -0000


> Another feature from Java that would be very nice in the module system
> is package scope. Currently, if any two modules wish to share=20
> bindings,
> they have to be entirely public and thus importable by=20
> anyone. But a big
> library often (practically always) has some common=20
> definitions that need
> to be shared by many modules in the library, but still are internal to
> the library and not meant for public consumption. A package=20
> scope would
> provide a means to enforce this.

I wouldn't advocate having a separate mechanism to support this.  If a
module "owns" a node in the hierarchy, then it also owns all children of
that node, so it can use nested modules for internal functionality.
This doesn't actually *enforce* the separation of the namespace because
anyone can directly import the internal module, but as long as clients
stick to the published interfaces it works fine.

Cheers,
	Simon