mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-23 04:50:28 +02:00
(gh_lookup): Call gh_module_lookup with
`scm_current_module ()', not `#f'. (gh_module_lookup): Expect a module instead of an obarray as first argument and do lookup in that module.
This commit is contained in:
parent
d204b24c16
commit
abc235ad1c
2 changed files with 14 additions and 6 deletions
|
@ -185,7 +185,7 @@ SCM gh_uniform_vector_ref (SCM v, SCM ilist);
|
||||||
#define gh_vector_to_list(v) scm_vector_to_list(v)
|
#define gh_vector_to_list(v) scm_vector_to_list(v)
|
||||||
|
|
||||||
SCM gh_lookup (const char *sname);
|
SCM gh_lookup (const char *sname);
|
||||||
SCM gh_module_lookup (SCM vector, const char *sname);
|
SCM gh_module_lookup (SCM module, const char *sname);
|
||||||
|
|
||||||
SCM gh_cons(SCM x, SCM y);
|
SCM gh_cons(SCM x, SCM y);
|
||||||
#define gh_list scm_listify
|
#define gh_list scm_listify
|
||||||
|
|
|
@ -700,18 +700,26 @@ gh_uniform_vector_ref (SCM v, SCM ilist)
|
||||||
SCM
|
SCM
|
||||||
gh_lookup (const char *sname)
|
gh_lookup (const char *sname)
|
||||||
{
|
{
|
||||||
return gh_module_lookup (SCM_BOOL_F, sname);
|
return gh_module_lookup (scm_current_module (), sname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SCM
|
SCM
|
||||||
gh_module_lookup (SCM vec, const char *sname)
|
gh_module_lookup (SCM module, const char *sname)
|
||||||
|
#define FUNC_NAME "gh_module_lookup"
|
||||||
{
|
{
|
||||||
SCM sym = gh_symbol2scm (sname);
|
SCM sym, cell;
|
||||||
if (SCM_EQ_P (scm_symbol_bound_p (vec, sym), SCM_BOOL_T))
|
|
||||||
return scm_symbol_binding (vec, sym);
|
SCM_VALIDATE_MODULE (SCM_ARG1, module);
|
||||||
|
|
||||||
|
sym = gh_symbol2scm (sname);
|
||||||
|
cell = scm_sym2vcell (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
|
||||||
|
if (cell != SCM_BOOL_F)
|
||||||
|
return SCM_CDR (cell);
|
||||||
else
|
else
|
||||||
return SCM_UNDEFINED;
|
return SCM_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
#undef FUNC_NAME
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Local Variables:
|
Local Variables:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue