It is possible to set up multiple configuration packages. The default configuration package opens the following structures:
more-structures-interface
at the end of the file scheme/more-packages.scm
.
You can define additional configuration packages by making a package that opens module-system and, optionally, built-in-structures, more-structures, or other structures that export structures and interfaces.
For example:
> ,config (define-structure foo (export) (open module-system built-in-structures more-structures)) > ,in foo foo> (define-structure x (export a b) (open scheme) (files x)) foo>
Unfortunately, the above example does not work.
The problem is that every environment in which
define-structure
is defined must also have a way to
create "reflective towers" (a misnomer; a better name would be
"syntactic towers").
A new reflective tower is required whenever a new environment is created for
compiling the source code in the package associated with a new structure.
The environment's tower is used at compile time for
evaluating the macro-source
in
and so forth. It is a "tower" because that environment, in turn, has to say what environment to use if(define-syntaxname
macro-source
) (let-syntax ((name
macro-source
)...
)body
)
macro-source
itself contains a use of let-syntax
.
The simplest way to provide a tower maker is to pass on the one used by
an existing configuration package.
The special form export-reflective-tower
creates an interface
that exports a configuration package's tower.
The following example uses export-reflective-tower
and
the ,structure
command to obtain a tower maker and create a new
configuration environment.
> ,config ,structure t (export-reflective-tower-maker) > ,config (define-structure foo (export) (open module-system t built-in-structures more-structures))
Previous: Command processor support | Next: Discussion