Go to the first, previous, next, last section, table of contents.


Library Level

The procedures and syntax described above are too coarse for serious end use. There is no provision to cache modules once loaded; There is no provision to resolve locations of shared module source or objects; The designation of modules (by filename) is file-system dependent.

As conceived above, the library level fills these gaps. The bindings for SLIB would be:

procedure: feature->module feature
Returns a module containing the exports for feature feature. If feature is not known an error is signaled.

procedure: require feature
Imports the modules necessary to provide feature feature. If feature is not known an error is signaled.

syntax: with-feature feature <body>
<body> is evaluated in the current environment augmented by the bindings from modules necessary to provide feature feature. The value of the last expression of <body> is returned. If feature is not known an error is signaled.

There will also be a procedure for augmenting SLIB's module registry.

When SLIB calls load-module, the resulting modules will be cached and simply imported when required again.

For each of SLIB's macro:LOAD procedures there will be a corresponding macro:LOAD-MODULE.


Go to the first, previous, next, last section, table of contents.