1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-10 05:50:26 +02:00

* Move all real functionality from scm_eval into inner_eval.

* Avoid to copy the evaluated expression twice.
This commit is contained in:
Dirk Herrmann 2001-01-22 13:32:08 +00:00
parent 9d7748147e
commit 312ae976ad
2 changed files with 14 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2001-01-22 Dirk Herrmann <D.Herrmann@tu-bs.de>
* eval.c (inner_eval, scm_eval): Move all real functionality into
inner_eval. Avoid to copy the expression twice by inlining some
code from scm_i_eval.
2001-01-19 Dirk Herrmann <D.Herrmann@tu-bs.de>
* eval.c (scm_m_case): The 'else' clause of a 'case' statement

View file

@ -3827,8 +3827,13 @@ inner_eval (void *data)
SCM pair = SCM_PACK (data);
SCM exp = SCM_CAR (pair);
SCM env = SCM_CDR (pair);
SCM result = scm_i_eval (exp, env);
return result;
SCM transformer = scm_fluid_ref (SCM_CDR (scm_system_transformer));
exp = scm_copy_tree (exp);
if (SCM_NIMP (transformer))
exp = scm_apply (transformer, exp, scm_listofnull);
return SCM_XEVAL (exp, env);
}
@ -3849,17 +3854,15 @@ SCM_DEFINE (scm_eval, "eval", 2, 0, 0,
"environment given by @var{environment specifier}.")
#define FUNC_NAME s_scm_eval
{
SCM copied_exp;
SCM env_closure;
SCM_VALIDATE_MODULE (2, environment);
copied_exp = scm_copy_tree (exp);
env_closure = scm_top_level_env (SCM_MODULE_EVAL_CLOSURE (environment));
return scm_internal_dynamic_wind
(change_environment, inner_eval, restore_environment,
(void *) SCM_UNPACK (scm_cons (copied_exp, env_closure)),
(void *) SCM_UNPACK (scm_cons (exp, env_closure)),
(void *) SCM_UNPACK (scm_cons (environment, SCM_BOOL_F)));
}
#undef FUNC_NAME