mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 13:00:26 +02:00
* 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.
This commit is contained in:
parent
0ba8a0a583
commit
23c46fa69a
1 changed files with 2 additions and 2 deletions
|
@ -1913,12 +1913,12 @@ dispatch:
|
||||||
t.arg1 = x;
|
t.arg1 = x;
|
||||||
while (SCM_NNULLP (t.arg1 = SCM_CDR (t.arg1)))
|
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);
|
SIDEVAL (SCM_CAR(x), env);
|
||||||
x = t.arg1;
|
x = t.arg1;
|
||||||
}
|
}
|
||||||
/* once more, for the last form */
|
/* 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
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue