Here is a simple example which I hope clarifies the nature of implicit
and explicit phasing:
$ cat bar.sls
#!r6rs
(library (bar)
(export x)
(import (rnrs))
(define x 1)
(display "invoked (bar)\n"))
$ cat no-phase.sps
#!r6rs
(import (rnrs)
(for (bar)))
(display "ran\n")
$
$ ikarus --r6rs-script no-phase.sps
ran
$ larceny --path . --r6rs --program no-phase.sps
ran
$ plt-r6rs ++path . no-phase.sps
ran
$ ypsilon --sitelib . no-phase.sps
invoked (bar)
ran
$
Note that Larceny and PLT did not instantiate (bar). They did not
because there are no phase levels in the (for (bar)).
Ikarus ignores the given (for ---) syntaxes. In implicit phasing, the
conceptual (for <import set> (meta <level>) ...) are implied by where
identifiers occur. If there are no identifiers, it is equivalent to
(for <import set>). If the identifiers occur at level 0, it is
equivalent to (for <import set> (meta 0)); at level 1, (for <import set>
(meta 1)); at levels 3 and 5, (for <import set> (meta 3) (meta 5)); etc.
See, implicit phasing really isn't that different semantically from the
users' perspective. It simply relieves you of having to figure out what
meta levels to specify, which is a significantly better difference.
There is the possibility of people getting confused about what phasing
is and when phases happen because, in explicitly phased systems, (import
(bar)) is implicitly equivalent to (import (for (bar) run)) and (import
(rnrs)) to (import (for (rnrs) run expand)) but everything else requires
explicit phase specifications. I think the fact that R6RS has (rnrs)
implicitly at both run and expand is strong evidence in support of the
advantage of implicit phasing -- why limit the significant convenience
to (rnrs) only?
In implicit phasing, if you import a library but don't reference
anything from it, it is equivalent to specifying no phase level. This
is why you should not expect such library to be instantiated. If you
expect (import (for (bar))) to instantiate (bar) just because you typed
an import syntax, you're from a different planet than the one I will
continue to live on.
--
: Derick
----------------------------------------------------------------