[Larceny-users] Behavior of eval in ERR5RS

AndrevanTonder andre at het.brown.edu
Sun Dec 30 13:00:45 EST 2007


On Sun, 30 Dec 2007, Ryan Newton wrote:

> However, under ERR5RS, no such luck:
>
> > (import (rnrs base) (primitives eval))
> > (define x 99)
> > (eval 'x)

> Error: Undefined global variable "x".
> -----------------------------------------------------------------
>
> Now, this is probably the intended behavior.  The R6RS eval requires
> an explicit environment for evaluation.  But I thought by doing import
> (primitives ...) I was getting access to the old larceny eval, with
> the "dirty" behavior that it inherits the top-level environment.

You do indeed get access to the dirty EVAL.  However, in ERR5RS
mode the above definition will not bind X but instead #X, where
# stands for some secret character that the expander prepends so
that it can control what is visible at the ERR5RS toplevel.

The best solution would be to extend the R6RS eval with
an ERR5RS (interaction-environment) capability.  I do not
foresee any particular difficulties with this, and would be
happy to provide it.  However, I will be travelling for the next
three weeks and will most likely only be able to look into
that after my return.

Andre



More information about the Larceny-users mailing list