summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2001-05-07 18:11:20 +0000
committerMarius Vollmer <mvo@zagadka.de>2001-05-07 18:11:20 +0000
commitabc235ad1cd66f8d0670c451a51352bfcdc1e97f (patch)
tree32e68ef6cd602a8d2aad07fb179d40e2f34f32ad
parentd204b24c16997253c00c651979a0e4faa6d571c8 (diff)
downloadguile-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.
-rw-r--r--libguile/gh.h2
-rw-r--r--libguile/gh_data.c18
2 files changed, 14 insertions, 6 deletions
diff --git a/libguile/gh.h b/libguile/gh.h
index 7afd5048d..834e4b775 100644
--- a/libguile/gh.h
+++ b/libguile/gh.h
@@ -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
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: