[plt-scheme] module hierarchy

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Jul 10 09:05:34 EDT 2006

At Sun, 9 Jul 2006 18:22:00 +0200, "Jos Koot" wrote:
> Is there a technical reason why a module must not contain 
> other modules? 

The design considerations for nested and top-level modules are subtly
different. For example, mutually dependent nested modules should be
allowed, since nested modules aren't compilation units.

> If there is no such technical problem, has it been considered 
> to allow submodules to be declared and required within a module?

The `package' form was supposed to be the nested-module form, along the
lines of `module' in Chez. I've never quite got `package' right,
though.

I keep trying to implement `package' as a macro, instead of extending
the core language of macro expansion. I still don't know how to make
that work, but I haven't yet given up on the approach.


Meanwhile, by convention, we put private modules in a "private"
sub-directory. Usually, there's enough private code that we want a
separate top-level module, anyway.

To prevent untrusted code for accessing exported bindings, use the
`protect' sub-form for `provide' and change the code inspector before
loading the untrusted code.

Matthew



Posted on the users mailing list.