[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] "module" vs. "library"

On Tue, Jul 5, 2011 at 10:46 PM, Andre van Tonder <andre@x> wrote:
> On Tue, 5 Jul 2011, John Cowan wrote:
>> It's not a feature subset of it, because R6RS doesn't have `include`.
> Why is INCLUDE conflated with the module language?  It is really an orthogonal
> concept.

Include has nothing to do with the motivation for the
module system.

The rationale is that we want room for future extensions -
e.g. the ability to have an import-lazy declaration (i.e. autoload),
or first-class interfaces and units, or versioned libraries, etc.
These are all things which must be handled at the module
level, so imported syntax is not an option.  However, the
R6RS module system is very rigid.  A module takes the
exact form of

  (library name (export ...) (import ...) body ...)

which leaves no room extension.  For example, if you
simply declare that import-lazy is a new optional form
that can occur at the beginning of the body, it conflicts
with any existing uses of import-lazy.

So as a purely syntactic convenience we wrap the body in
a separate form, and avoid any namespace conflicts.

This is orthogonal to the means by which the module
syntax is extended, the most likely contenders being
purely syntactic (i.e. module is just a macro) or with
some sort of meta-language as in Racket or Scheme48.
We don't need to specify this in WG1 (if ever).


Scheme-reports mailing list