[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A portable implementation
I have completed a portable implementation of SRFI-83. This
implementation is fully integrated with my portable SRFI-72 macro
It can be found at:
and will be updated, time permitting, as SRFI-83 evolves.
The semantics is as in SRFI-83, but has been extended to
allow import into higher phases (as is need when let-syntax
(library "m" "scheme://r6rs"
(define z 1))
(import (for "m" run expand 2)) ; also (import (for "m" 0 1 2 ...))
(let-syntax ((foo (lambda (form)
(let-syntax ((bar (lambda (form)
(quasisyntax (list z ,z ,,z))))))
;==> (1 1 1)
The import syntax is:
(for <import-set> <import-phase>*)
<import-phase> ::= run | expand | all | 0 | 1 | 2 | ...
Here 0 == run, 1 == expand, and |all| wil cause import into
all phases, which is implicitly done with the <language>.
See the link for many commented examples of use.
The semantics is as follows:
To invoke a library at phase N:
* Invoke at phase N any library that is imported by this library
for run time, and that is not yet invoked at phase N.
* Evaluate all variable definitions and top-level expressions within
the library. (Macro definitions are not evaluated.)
To visit a library at phase N:
* For each k >= 1, invoke at phase N+k any library that is imported
by this library for .... (phase k), and that is not yet invoked at
* For each k >= 0, visit at phase N+k any library that is imported by
this library for .... (phase k), and that is not yet visited at phase
* Evaluate all syntax definitions within the library.
(Top-level expressions are not evaluated, and the right-hand sides
of variable definitions are not evaluated.)
* We do not enforce the no-shadowing and no-multiple-import
* We allow different bindings for the same identifier to be
imported into different phases.
See the link for further description and commented examples.