*** empty log message ***
[bpt/guile.git] / libguile / evalext.c
index 9fefca6..b9e0130 100644 (file)
@@ -1,4 +1,4 @@
-/*     Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+/*     Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 \f
 
-#include "_scm.h"
-#include "eval.h"
-#include "macros.h"
-#include "modules.h"
+#include "libguile/_scm.h"
+#include "libguile/eval.h"
+#include "libguile/macros.h"
+#include "libguile/modules.h"
+#include "libguile/fluids.h"
 
-#include "validate.h"
-#include "evalext.h"
+#include "libguile/validate.h"
+#include "libguile/evalext.h"
 
 SCM_SYMBOL (scm_sym_setter, "setter");
 
@@ -78,7 +79,9 @@ SCM_DEFINE (scm_definedp, "defined?", 1, 1, 0,
 
   if (SCM_UNBNDP (env))
     vcell = scm_sym2vcell(sym,
-                         SCM_CDR (scm_top_level_lookup_closure_var),
+                         scm_module_system_booted_p
+                         ? SCM_TOP_LEVEL_LOOKUP_CLOSURE
+                         : SCM_EOL,
                          SCM_BOOL_F);
   else
     {
@@ -95,12 +98,12 @@ SCM_DEFINE (scm_definedp, "defined?", 1, 1, 0,
            {
              if (SCM_NCONSP (b))
                {
-                 if (b == sym)
+                 if (SCM_EQ_P (b, sym))
                    return SCM_BOOL_T;
                  else
                    break;
                }
-             if (SCM_CAR (b) == sym)
+             if (SCM_EQ_P (SCM_CAR (b), sym))
                return SCM_BOOL_T;
            }
        }
@@ -109,7 +112,7 @@ SCM_DEFINE (scm_definedp, "defined?", 1, 1, 0,
                           SCM_BOOL_F);
     }
              
-  return (vcell == SCM_BOOL_F || SCM_UNBNDP (SCM_CDR (vcell))
+  return (SCM_FALSEP (vcell) || SCM_UNBNDP (SCM_CDR (vcell))
          ? SCM_BOOL_F
          : SCM_BOOL_T);
 }
@@ -124,22 +127,13 @@ scm_m_undefine (SCM x, SCM env)
   SCM arg1 = x;
   x = SCM_CDR (x);
   SCM_ASSYNT (SCM_TOP_LEVEL (env), arg1, "bad placement ", s_undefine);
-  SCM_ASSYNT (SCM_CONSP (x) && SCM_CDR (x) == SCM_EOL,
+  SCM_ASSYNT (SCM_CONSP (x) && SCM_NULLP (SCM_CDR (x)),
              arg1, scm_s_expression, s_undefine);
   x = SCM_CAR (x);
   SCM_ASSYNT (SCM_SYMBOLP (x), arg1, scm_s_variable, s_undefine);
   arg1 = scm_sym2vcell (x, scm_env_top_level (env), SCM_BOOL_F);
   SCM_ASSYNT (SCM_NFALSEP (arg1) && !SCM_UNBNDP (SCM_CDR (arg1)),
              x, "variable already unbound ", s_undefine);
-#if 0
-#ifndef SCM_RECKLESS
-  if (SCM_NIMP (SCM_CDR (arg1)) && ((SCM) SCM_SNAME (SCM_CDR (arg1)) == x))
-    scm_warn ("undefining built-in ", SCM_CHARS (x));
-  else
-#endif
-    if (5 <= scm_verbose && SCM_UNDEFINED != SCM_CDR (arg1))
-      scm_warn ("redefining ", SCM_CHARS (x));
-#endif
   SCM_SETCDR (arg1, SCM_UNDEFINED);
 #ifdef SICP
   return SCM_CAR (arg1);
@@ -148,14 +142,19 @@ scm_m_undefine (SCM x, SCM env)
 #endif
 }
 
-/* This name is obsolete.  Will be removed in 1.5.  */
-SCM_REGISTER_PROC (s_serial_map, "serial-map", 2, 0, 1, scm_map);
-
 SCM_REGISTER_PROC (s_map_in_order, "map-in-order", 2, 0, 1, scm_map);
 
 void 
 scm_init_evalext ()
 {
   scm_make_synt (scm_s_set_x, scm_makmmacro, scm_m_generalized_set_x);
-#include "evalext.x"
+#ifndef SCM_MAGIC_SNARFER
+#include "libguile/evalext.x"
+#endif
 }
+
+/*
+  Local Variables:
+  c-file-style: "gnu"
+  End:
+*/