mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-22 20:40:29 +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)
|
||||
|
||||
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);
|
||||
#define gh_list scm_listify
|
||||
|
|
|
@ -700,18 +700,26 @@ gh_uniform_vector_ref (SCM v, SCM ilist)
|
|||
SCM
|
||||
gh_lookup (const char *sname)
|
||||
{
|
||||
return gh_module_lookup (SCM_BOOL_F, sname);
|
||||
return gh_module_lookup (scm_current_module (), sname);
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
if (SCM_EQ_P (scm_symbol_bound_p (vec, sym), SCM_BOOL_T))
|
||||
return scm_symbol_binding (vec, sym);
|
||||
SCM sym, cell;
|
||||
|
||||
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
|
||||
return SCM_UNDEFINED;
|
||||
}
|
||||
#undef FUNC_NAME
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue