[plt-scheme] eval and phases (v4.0.1.2)

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Jun 26 16:38:14 EDT 2008

At Thu, 26 Jun 2008 15:49:34 -0400, "Sam TH" wrote:
> On Wed, Jun 25, 2008 at 2:55 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> > As of version (now in SVN):
> >
> >  1. Each namespace has a "base phase" that is used by `eval',
> >    `dynamic-require', etc., instead of always starting in phase 0.
> >
> >  2. While compile-time expressions are evaluated (such as the body of a
> >    macro transformer or the right-hand side of `define-for-syntax'),
> >    the current namespace is set to one whose base phase matches the
> >    evaluation phase.
> I have a couple issues with this.  First, the following seems like a
> bug.  If you put this module in the Module language, and hit run:

More simply

 #lang scheme/base

 (define-namespace-anchor anch)
 (parameterize ([current-namespace (namespace-anchor->namespace anch)])
   (eval '(+ 3 3)))

This bug is fixed in SVN. (It had to do with lazily creating the
lexical information for syntax objects in the body of a module.
Roughly, a `force' was missing.)

> Second, in the new regime, how can I accomplish what this macro is
> trying to do, since the current version no longer works?

I'm not sure I understand. Is it just a question of fixing the bug


Posted on the users mailing list.