- SCM obarr= SCM_MODULE_OBARRAY (mod);
-
- return scm_internal_hash_fold ((Hash_cl_func) &entry_to_alist, NULL, SCM_EOL, obarr);
-}
-
-/* Lookup SYM, but don't give error when it is not defined. */
-SCM
-ly_module_lookup (SCM module, SCM sym)
-{
-#define FUNC_NAME __FUNCTION__
- SCM_VALIDATE_MODULE (1, module);
-
- return scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
-#undef FUNC_NAME
-}
-
-/* Lookup SYM in a list of modules, which do not have to be related.
- Return the first instance. */
-LY_DEFINE (ly_modules_lookup, "ly:modules-lookup",
- 2, 1, 0,
- (SCM modules, SCM sym, SCM def),
- "Lookup @var{sym} in the list @var{modules}, "
- "returning the first occurence. "
- "If not found, return @var{default}, or @code{#f}.")
-{
- for (SCM s = modules; scm_is_pair (s); s = scm_cdr (s))
- {
- SCM mod = scm_car (s);
- SCM v = scm_sym2var (sym, scm_module_lookup_closure (mod),
- SCM_UNDEFINED);
- if (SCM_VARIABLEP(v) && SCM_VARIABLE_REF(v) != SCM_UNDEFINED)
- return SCM_VARIABLE_REF(v);
- }