diff options
author | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2003-04-20 18:08:07 +0000 |
---|---|---|
committer | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2003-04-20 18:08:07 +0000 |
commit | a44a9715eb32e78b6cc0ed6908694ce43564ac02 (patch) | |
tree | 0869adcf3102324adcb8a485a473c7c568136887 | |
parent | 05a6b2d3cce4d0f70f760b41c3838489e82be667 (diff) | |
download | guile-a44a9715eb32e78b6cc0ed6908694ce43564ac02.tar.gz |
* eval.c, root.h (scm_undefineds, SCM_NUM_PROTECTS, undefineds,
scm_init_eval): Made scm_undefineds static in eval.c, renamed it
to undefineds and registered the object as a permanent object.
* eval.c, eval.h (scm_f_apply, scm_init_eval): Made scm_f_apply
static in eval.c, renamed it to f_apply and registered the object
as a permanent object.
-rw-r--r-- | libguile/ChangeLog | 10 | ||||
-rw-r--r-- | libguile/eval.c | 33 | ||||
-rw-r--r-- | libguile/eval.h | 2 | ||||
-rw-r--r-- | libguile/root.h | 25 |
4 files changed, 39 insertions, 31 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index ce35f59a3..8986d014a 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,15 @@ 2003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de> + * eval.c, root.h (scm_undefineds, SCM_NUM_PROTECTS, undefineds, + scm_init_eval): Made scm_undefineds static in eval.c, renamed it + to undefineds and registered the object as a permanent object. + + * eval.c, eval.h (scm_f_apply, scm_init_eval): Made scm_f_apply + static in eval.c, renamed it to f_apply and registered the object + as a permanent object. + +2003-04-20 Dirk Herrmann <D.Herrmann@tu-bs.de> + * eval.c (SCM_BIT8, SCM_BIT8, unmemocopy, SCM_CEVAL): Renamed file-local macro SCM_BIT8 to SCM_BIT7, which is more appropriate. diff --git a/libguile/eval.c b/libguile/eval.c index 5cb707c6a..d4e8ef4b0 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -399,8 +399,6 @@ SCM_GLOBAL_SYMBOL (scm_sym_else, "else"); SCM_GLOBAL_SYMBOL (scm_sym_unquote, "unquote"); SCM_GLOBAL_SYMBOL (scm_sym_uq_splicing, "unquote-splicing"); -SCM scm_f_apply; - SCM_GLOBAL_SYMBOL (scm_sym_enter_frame, "enter-frame"); SCM_GLOBAL_SYMBOL (scm_sym_apply_frame, "apply-frame"); SCM_GLOBAL_SYMBOL (scm_sym_exit_frame, "exit-frame"); @@ -1247,6 +1245,13 @@ scm_macroexp (SCM x, SCM env) goto macro_tail; } +#define SCM_BIT7(x) (127 & SCM_UNPACK (x)) + +/* A function object to implement "apply" for non-closure functions. */ +static SCM f_apply; +/* An endless list consisting of #<undefined> objects: */ +static SCM undefineds; + /* scm_unmemocopy takes a memoized expression together with its * environment and rewrites it to its original form. Thus, it is the * inversion of the rewrite rules above. The procedure is not @@ -1262,8 +1267,6 @@ scm_macroexp (SCM x, SCM env) * This ought to change. */ -#define SCM_BIT7(x) (127 & SCM_UNPACK (x)) - static SCM build_binding_list (SCM names, SCM inits) { @@ -2195,7 +2198,7 @@ dispatch: case SCM_BIT7 (SCM_IM_LETREC): x = SCM_CDR (x); - env = EXTEND_ENV (SCM_CAR (x), scm_undefineds, env); + env = EXTEND_ENV (SCM_CAR (x), undefineds, env); x = SCM_CDR (x); { SCM init_forms = SCM_CAR (x); @@ -2332,7 +2335,7 @@ dispatch: } else { - proc = scm_f_apply; + proc = f_apply; goto evapply; } @@ -4477,9 +4480,8 @@ SCM_DEFINE (scm_eval, "eval", 2, 0, 0, /* At this point, scm_deval and scm_dapply are generated. */ -# define DEVAL -# include "eval.c" - +#define DEVAL +#include "eval.c" void @@ -4497,15 +4499,14 @@ scm_init_eval () scm_set_smob_free (scm_tc16_promise, promise_free); scm_set_smob_print (scm_tc16_promise, promise_print); - /* Dirk:Fixme:: make scm_undefineds local to eval.c: it's only used here. */ - scm_undefineds = scm_list_1 (SCM_UNDEFINED); - SCM_SETCDR (scm_undefineds, scm_undefineds); - scm_listofnull = scm_list_1 (SCM_EOL); + undefineds = scm_list_1 (SCM_UNDEFINED); + SCM_SETCDR (undefineds, undefineds); + scm_permanent_object (undefineds); - scm_f_apply = scm_c_define_subr ("apply", scm_tc7_lsubr_2, scm_apply); + scm_listofnull = scm_list_1 (SCM_EOL); - /* acros */ - /* end of acros */ + f_apply = scm_c_define_subr ("apply", scm_tc7_lsubr_2, scm_apply); + scm_permanent_object (f_apply); #include "libguile/eval.x" diff --git a/libguile/eval.h b/libguile/eval.h index 3eb17fdee..bff1a6447 100644 --- a/libguile/eval.h +++ b/libguile/eval.h @@ -163,8 +163,6 @@ SCM_API SCM scm_sym_apply; SCM_API SCM scm_sym_set_x; SCM_API SCM scm_sym_args; -SCM_API SCM scm_f_apply; - SCM_API SCM * scm_ilookup (SCM iloc, SCM env); diff --git a/libguile/root.h b/libguile/root.h index 4c86bb45e..6d0e5d38f 100644 --- a/libguile/root.h +++ b/libguile/root.h @@ -30,19 +30,18 @@ #define scm_flo0 scm_sys_protects[0] #define scm_listofnull scm_sys_protects[1] -#define scm_undefineds scm_sys_protects[2] -#define scm_nullvect scm_sys_protects[3] -#define scm_nullstr scm_sys_protects[4] -#define scm_keyword_obarray scm_sys_protects[5] -#define scm_stand_in_procs scm_sys_protects[6] -#define scm_object_whash scm_sys_protects[7] -#define scm_permobjs scm_sys_protects[8] -#define scm_asyncs scm_sys_protects[9] -#define scm_protects scm_sys_protects[10] -#define scm_properties_whash scm_sys_protects[11] -#define scm_gc_registered_roots scm_sys_protects[12] -#define scm_source_whash scm_sys_protects[13] -#define SCM_NUM_PROTECTS 14 +#define scm_nullvect scm_sys_protects[2] +#define scm_nullstr scm_sys_protects[3] +#define scm_keyword_obarray scm_sys_protects[4] +#define scm_stand_in_procs scm_sys_protects[5] +#define scm_object_whash scm_sys_protects[6] +#define scm_permobjs scm_sys_protects[7] +#define scm_asyncs scm_sys_protects[8] +#define scm_protects scm_sys_protects[9] +#define scm_properties_whash scm_sys_protects[10] +#define scm_gc_registered_roots scm_sys_protects[11] +#define scm_source_whash scm_sys_protects[12] +#define SCM_NUM_PROTECTS 13 SCM_API SCM scm_sys_protects[]; |