guile-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

guile/guile-core/libguile modules.c


From: Marius Vollmer
Subject: guile/guile-core/libguile modules.c
Date: Sat, 13 Oct 2001 11:40:29 -0400

CVSROOT:        /cvs
Module name:    guile
Changes by:     Marius Vollmer <address@hidden> 01/10/13 11:40:29

Modified files:
        guile-core/libguile: modules.c 

Log message:
        (module_variable): Pass over variables that exist but are unbound.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/guile/guile-core/libguile/modules.c.diff?cvsroot=OldCVS&tr1=1.34&tr2=1.35&r1=text&r2=text

Patches:
Index: guile/guile-core/libguile/modules.c
diff -u guile/guile-core/libguile/modules.c:1.34 
guile/guile-core/libguile/modules.c:1.35
--- guile/guile-core/libguile/modules.c:1.34    Fri Aug 31 10:42:31 2001
+++ guile/guile-core/libguile/modules.c Sat Oct 13 11:40:29 2001
@@ -269,9 +269,13 @@
 static SCM
 module_variable (SCM module, SCM sym)
 {
+#define SCM_BOUND_THING_P(b) \
+  (SCM_NFALSEP(b) && \
+   (!SCM_VARIABLEP(b) || !SCM_UNBNDP (SCM_VARIABLE_REF (b))))
+
   /* 1. Check module obarray */
   SCM b = scm_hashq_ref (SCM_MODULE_OBARRAY (module), sym, SCM_UNDEFINED);
-  if (SCM_VARIABLEP (b))
+  if (SCM_BOUND_THING_P (b))
     return b;
   {
     SCM binder = SCM_MODULE_BINDER (module);
@@ -279,7 +283,7 @@
       /* 2. Custom binder */
       {
        b = scm_call_3 (binder, module, sym, SCM_BOOL_F);
-       if (SCM_NFALSEP (b))
+       if (SCM_BOUND_THING_P (b))
          return b;
       }
   }
@@ -289,12 +293,13 @@
     while (SCM_CONSP (uses))
       {
        b = module_variable (SCM_CAR (uses), sym);
-       if (SCM_NFALSEP (b))
+       if (SCM_BOUND_THING_P (b))
          return b;
        uses = SCM_CDR (uses);
       }
     return SCM_BOOL_F;
   }
+#undef SCM_BOUND_THING_P
 }
 
 scm_t_bits scm_tc16_eval_closure;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]