-static SCM
-ly_module_define (void *closure, SCM key, SCM val, SCM result)
-{
- (void) result;
- SCM module = (SCM) closure;
- if (scm_variable_bound_p (val) == SCM_BOOL_T)
- scm_module_define (module, key, scm_variable_ref (val));
- return SCM_EOL;
-}
-
-/* Ugh signature of scm_internal_hash_fold () is inaccurate. */
-typedef SCM (*Hash_cl_func)();
-
-/*
- Check me. This is NOT an actual import. It just copies the
- definitions.
-
- If a variable in changed in SRC, we DEST doesn't see the
- definitions.
- */
-LY_DEFINE (ly_import_module, "ly:import-module",
- 2, 0, 0, (SCM dest, SCM src),
- "Import all bindings from module SRC into DEST.")
-{
- SCM_VALIDATE_MODULE (1, src);
- scm_internal_hash_fold ((Hash_cl_func) &ly_module_define, (void*) dest,
- SCM_EOL, SCM_MODULE_OBARRAY (src));
- return SCM_UNSPECIFIED;
-}
-
-static SCM
-accumulate_symbol (void *closure, SCM key, SCM val, SCM result)
-{
- (void) closure;
- (void) val;
- return scm_cons (key, result);
-}
-