The lexical environment of a function is stored in the same IHS record as its name.

This commit is contained in:
Juan Jose Garcia Ripoll 2008-06-08 22:13:45 +02:00
parent 2ac39d71bb
commit 18d0ffb0f4
4 changed files with 4 additions and 6 deletions

View file

@ -489,15 +489,13 @@ static cl_object
interpret_funcall(cl_object lex_env, cl_narg narg, cl_object fun)
{
struct ecl_stack_frame frame_aux;
struct ihs_frame ihs;
ihs_push(&ihs, fun, lex_env);
cl_env.ihs_top->lex_env = lex_env;
frame_aux.t = t_frame;
frame_aux.stack = cl_env.stack;
frame_aux.top = cl_env.stack_top;
frame_aux.bottom = frame_aux.top - narg;
fun = ecl_apply_from_stack_frame((cl_object)&frame_aux, fun);
ecl_stack_frame_close((cl_object)&frame_aux);
ihs_pop();
return fun;
}

View file

@ -234,7 +234,7 @@ si_ihs_fun(cl_object arg)
cl_object
si_ihs_env(cl_object arg)
{
@(return get_ihs_ptr(fixnnint(si_ihs_next(arg)))->lex_env)
@(return get_ihs_ptr(fixnnint(arg))->lex_env)
}
/********************** FRAME STACK *************************/

View file

@ -77,7 +77,7 @@ typedef struct ihs_frame {
} *ihs_ptr;
#define ihs_push(r,f,e) do { \
(r)->next=cl_env.ihs_top; (r)->function=(f); (r)->lex_env= (e); \
(r)->next=cl_env.ihs_top; (r)->function=(f); (r)->lex_env=(e); \
(r)->index=cl_env.ihs_top->index+1;\
cl_env.ihs_top = (r); \
} while(0)

View file

@ -781,7 +781,7 @@ under certain conditions; see file 'Copyright' for details.")
(set-break-env))
(defun set-break-env ()
(setq *break-env* (if (= *ihs-current* *ihs-top*) nil (ihs-env *ihs-current*))))
(setq *break-env* (ihs-env *ihs-current*)))
(defun ihs-search (string unrestricted &optional (start (si::ihs-top 'tpl)))
(do ((ihs start (si::ihs-prev ihs)))