diff options
author | Marius Vollmer <mvo@zagadka.de> | 2001-05-07 18:11:20 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2001-05-07 18:11:20 +0000 |
commit | abc235ad1cd66f8d0670c451a51352bfcdc1e97f (patch) | |
tree | 32e68ef6cd602a8d2aad07fb179d40e2f34f32ad /libguile/gh_data.c | |
parent | d204b24c16997253c00c651979a0e4faa6d571c8 (diff) | |
download | guile-abc235ad1cd66f8d0670c451a51352bfcdc1e97f.tar.gz |
(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.
Diffstat (limited to 'libguile/gh_data.c')
-rw-r--r-- | libguile/gh_data.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/libguile/gh_data.c b/libguile/gh_data.c index 48361645b..0ee8896a9 100644 --- a/libguile/gh_data.c +++ b/libguile/gh_data.c @@ -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: |