summaryrefslogtreecommitdiff
path: root/libguile/modules.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2001-10-13 15:40:29 +0000
committerMarius Vollmer <mvo@zagadka.de>2001-10-13 15:40:29 +0000
commitdc187f33fdc9142d030daa565eddff76bcc8b667 (patch)
tree446e65ecea027ba47852ae875cdf5b3f694f1e8b /libguile/modules.c
parent3756da52d9eebdb54481bfb1783e847a04a2a5b7 (diff)
downloadguile-dc187f33fdc9142d030daa565eddff76bcc8b667.tar.gz
(module_variable): Pass over variables that exist but are unbound.
Diffstat (limited to 'libguile/modules.c')
-rw-r--r--libguile/modules.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libguile/modules.c b/libguile/modules.c
index 1d6040d62..1c458683e 100644
--- a/libguile/modules.c
+++ b/libguile/modules.c
@@ -269,9 +269,13 @@ static SCM module_make_local_var_x_var;
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 @@ module_variable (SCM module, SCM sym)
/* 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 @@ module_variable (SCM module, SCM sym)
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;