* eval.c, root.h (scm_undefineds, SCM_NUM_PROTECTS, undefineds,
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Sun, 20 Apr 2003 18:08:07 +0000 (18:08 +0000)
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Sun, 20 Apr 2003 18:08:07 +0000 (18:08 +0000)
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.

libguile/ChangeLog
libguile/eval.c
libguile/eval.h
libguile/root.h

index ce35f59..8986d01 100644 (file)
@@ -1,3 +1,13 @@
+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
index 5cb707c..d4e8ef4 100644 (file)
@@ -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"
   
index 3eb17fd..bff1a64 100644 (file)
@@ -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;
-
 \f
 
 SCM_API SCM * scm_ilookup (SCM iloc, SCM env);
index 4c86bb4..6d0e5d3 100644 (file)
 
 #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[];