[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eval.scm




   Date: Sun, 8 Feb 1998 15:53:06 -0500 (EST)
   From: Aubrey Jaffer <jaffer@ai.mit.edu>

   I believe the enclosed code implements R5RS' two-argument EVAL for
   SLIB-supporting Schemes in terms of one-argument EVAL here named
   slib:eval (which can be defined using LOAD).

   The environment returned by (INTERACTION-ENVIRONMENT) is mutable.
   When EVAL is called with the interaction environment, it restores the
   environment stack (EVAL::SAVED-ENVIRONMENTS), evaluates the
   expression, and then rebinds the environments in their original order,
   capturing top-level binding changes at each step.

I don't think this code works correctly.  Consider the following:

    (let ((f (eval '(lambda (x) (+ x 1))
                   (scheme-report-environment 5))))
      (set! + -)
      (f 0))

This should return 1 but I believe that in your implementation
it would return -1.
                               -Richard Kelsey