On Wed, 2009-09-16 at 13:05 -0400, Andre van Tonder wrote:
> On Wed, 16 Sep 2009, Aaron W. Hsu wrote:
> 
> > On Tue, 15 Sep 2009 22:36:35 -0400, Ray Dillinger <[email protected]> wrote:
> >
> >> Seriously, it seems to be a construct that causes considerable
> >> hair in Common Lisp, and nobody knows how to make it less hairy.
> >
> > EVAL-WHEN is very hairy, and that is precisely why everyone avoids using
> > it whenever possible.
> 
> The phase semantics of R6RS libraries was designed (see the initial
> paper by Matthew Flatt) to address this problem and mostly eliminate the
> need for eval-when.
> 
> There are those who rightly complain that library phases are complicated.
> That is true, but they are considerably less hairy than eval-when.

I agree phases are better than eval-when, and, as a relative beginner,
I've found them pleasant to work with.

> Ikarus simplifies this problem by doing automatic
> phase inference, but this may cause other problems for inexpert users.

I disagree that Ikarus's phase inference causes other problems for
inexpert users, if "other problems" means problems they would not
encounter with explicit phasing systems.  The phasing issues are the
same in any R6RS system (ignoring single and multiple instantiation
which are a separate issue).  All that explicit phasing gives is a
verified annotation of what phases you intend imports to be
instantiated/visited at (and I contend that export levels other than 0
make these annotations more confusing than helpful).  "Inexpert" users
already do not understand the ramifications of phasing and so the
explicit phasing annotations have little to no meaning to them.  These
users only know they sometimes (but often not for (rnrs)) need to do
some mysterious export levels plus declared import levels arithmetic so
they can get their code to work where they've *already decided* to
reference bindings at whatever phases.  Once they get their imports to
work, they'll encounter the same phase problems they would with implicit
phasing.  Further, inexpert users regularly accidentally include
unnecessary levels because they don't understand what levels are
necessary, and for systems which always instantiate/visit libraries for
every given level, this could cause additional phase problems which
would not happen in an implicit phasing system.
 
> IMHO, while we have made a start in R6RS, the problem of phases remains to be 
> satisfactorily addressed.

I recently said this to someone else:

        I'm willing to continue using "explicit phasing" to keep my code
        portable and to gain more experience with it.  So far (2 years),
        I've become more convinced I like "implicit phasing" better.  I
        think a better compromise would be that imports without level
        declarations are always "implicit phasing" and imports with
        level declarations are always verified (which I suppose would
        always require declarations for level 0 to verify that only
        level 0 is used, and I see that as more consistent with the
        purpose of "explicit phasing"), instead of the current
        compromise where "implicit phasing" style is not portable and
        "explicit phasing" style is ignored by some systems and so not
        portable according to the authors' intent  -- this way both
        sides can do it their way *and* be portable.

-- 
: Derick
----------------------------------------------------------------


_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to