[Larceny-users] use cases for explicit phase separation

Michele Simionato michele.simionato at gmail.com
Tue Apr 28 08:53:37 EDT 2009


As some of you will know, I am writing a long series of blog posts
about Scheme, which I have named "The Adventures of a Pythonista in
Schemeland" (http://www.artima.com/weblogs/viewpost.jsp?thread=251474).
At the present, I am writing the part concerning the R6RS module
system. In particular, I want to explain the difference between
systems with implicit phasing (like Ikarus) and systems with explicit
phasing (like PLT and Larceny). The difference - as you know - is that
systems like Larceny can import names into a specific phase, whereas
Ikarus necessarily imports the names into all phases. In principle
Larceny and PLT are more powerful, since they offer more control on how names
are imported; in practice however I am having trouble in finding real
life use cases where to import names into a specific phase only is
necessary. So I am asking for input from people using Larceny:
how do you use the explicit phasing mechanism?

The thing that troubles me is that the R6RS forbids the same name
to be used with different bindings in different phases.
Therefore, if I import the name 'x' at expand time (just to make
an example) I am basically reserving the name 'x' for all phases,
since I cannot reuse 'x' in other phases, unless it has the same
binding as the first 'x'. In other words, the namespaces in the
different phases are not really separated, and it seems to me
that you may as well import the name 'x' in all phases, since
you cannot use it with another meaning anyway.

It seems to me that the only use for importing 'x' at expand time only
is to forbid accidental shadowing of 'x' at runtime or viceversa,
if you exchange runtime with expand time.

Do you have any thoughts on the question?

         Michele Simionato



More information about the Larceny-users mailing list