From 23c46fa69a0e5491ef6d36b01d48954e528b19dd Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 22 Feb 2001 20:54:12 +0000 Subject: [PATCH] * eval.c (scm_ceval, scm_deval): When evaluating expressions on top level, create a fresh top-level environment for each expression instead of mutating the exisint frame. This is important when that frame is closed over. --- libguile/eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libguile/eval.c b/libguile/eval.c index 22ee142ee..2b245f1b5 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1913,12 +1913,12 @@ dispatch: t.arg1 = x; while (SCM_NNULLP (t.arg1 = SCM_CDR (t.arg1))) { - SCM_SETCAR (env, scm_current_module_lookup_closure ()); + env = scm_top_level_env (scm_current_module_lookup_closure ()); SIDEVAL (SCM_CAR(x), env); x = t.arg1; } /* once more, for the last form */ - SCM_SETCAR (env, scm_current_module_lookup_closure ()); + env = scm_top_level_env (scm_current_module_lookup_closure ()); } else {