mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-01 12:20:26 +02:00
(module_variable): Pass over variables that exist but are unbound.
This commit is contained in:
parent
3756da52d9
commit
dc187f33fd
1 changed files with 8 additions and 3 deletions
|
@ -269,9 +269,13 @@ static SCM module_make_local_var_x_var;
|
||||||
static SCM
|
static SCM
|
||||||
module_variable (SCM module, SCM sym)
|
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 */
|
/* 1. Check module obarray */
|
||||||
SCM b = scm_hashq_ref (SCM_MODULE_OBARRAY (module), sym, SCM_UNDEFINED);
|
SCM b = scm_hashq_ref (SCM_MODULE_OBARRAY (module), sym, SCM_UNDEFINED);
|
||||||
if (SCM_VARIABLEP (b))
|
if (SCM_BOUND_THING_P (b))
|
||||||
return b;
|
return b;
|
||||||
{
|
{
|
||||||
SCM binder = SCM_MODULE_BINDER (module);
|
SCM binder = SCM_MODULE_BINDER (module);
|
||||||
|
@ -279,7 +283,7 @@ module_variable (SCM module, SCM sym)
|
||||||
/* 2. Custom binder */
|
/* 2. Custom binder */
|
||||||
{
|
{
|
||||||
b = scm_call_3 (binder, module, sym, SCM_BOOL_F);
|
b = scm_call_3 (binder, module, sym, SCM_BOOL_F);
|
||||||
if (SCM_NFALSEP (b))
|
if (SCM_BOUND_THING_P (b))
|
||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -289,12 +293,13 @@ module_variable (SCM module, SCM sym)
|
||||||
while (SCM_CONSP (uses))
|
while (SCM_CONSP (uses))
|
||||||
{
|
{
|
||||||
b = module_variable (SCM_CAR (uses), sym);
|
b = module_variable (SCM_CAR (uses), sym);
|
||||||
if (SCM_NFALSEP (b))
|
if (SCM_BOUND_THING_P (b))
|
||||||
return b;
|
return b;
|
||||||
uses = SCM_CDR (uses);
|
uses = SCM_CDR (uses);
|
||||||
}
|
}
|
||||||
return SCM_BOOL_F;
|
return SCM_BOOL_F;
|
||||||
}
|
}
|
||||||
|
#undef SCM_BOUND_THING_P
|
||||||
}
|
}
|
||||||
|
|
||||||
scm_t_bits scm_tc16_eval_closure;
|
scm_t_bits scm_tc16_eval_closure;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue