[plt-scheme] eval and interaction-enviroment in R5RS
Hi all,
I was a bit puzzled when I tried the following code in DrScheme:
(define x 0)
(let ((x 1))
(eval '(set! x 2) (interaction-environment))
x)
x
When running this in R5RS mode, it outputs 1 and then 2, while I would
expect 2 and then 0. About interaction-environment, R5RS states that
"The intent is that this procedure will return the environment in which
the implementation would evaluate expressions dynamically typed by the
user". So I expected the set! expression to work on the local x
variable, while PLT appears to take the top-level one. What do you think?
Bas