The module system outlined above should work well for SLIB. Using
load-module
, most SLIB modules will work without modification.
Correspondents have expressed concern over a variety of issues.
module?
.
define-internal
is not strictly necessary and can be emulated
with convoluted coding. But it is convenient and directly satisfies one
of the capabilities people expect from a module system.
define-syntax-internal
is not necessary because
letrec-syntax
will suffice.
export
syntax were supported.
export
form occurs at top level in code for a module (argument to
module
, make-module
, or load-module
), then the
returned binding contour is modified as follows: Only ident1,
ident2, ... are exported.
It is an error if a module has more than one export
statement.
It is an error if an identifier occurs more than once in an
export
statement. It is an error if ident1, ident2,
... are not all defined at top level in the code for the module
containing the export
statement.
export
has been winning the popularity contest with
define-internal
.
compile-module-file
compiles the module specified by its string
filename argument and returns a value suitable for passing as an
argument to import-compiled-module
, or #f
if the
compilation was not successful.
If the value returned by compile-module-file
is a string, then it
can name a file produced by compile-module-file
, which can be
passed to import-compiled-module
in the future without
re-compilation.
Go to the first, previous, next, last section, table of contents.