1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-21 12:10:26 +02:00

scm_[current_]module_transformer returns the %pre-modules-transformer, if set

* libguile/modules.c (scm_module_transformer)
  (scm_current_module_transformer): So, if the module system hasn't yet
  booted, take the current transformer from a variable named
  %pre-modules-transformer from the %pre-modules-obarray. This is a
  prequel to booting syncase early in boot-9.
This commit is contained in:
Andy Wingo 2009-03-09 20:49:54 +01:00
parent dec62b5ef8
commit b7e6589fff

View file

@ -577,11 +577,20 @@ scm_current_module_lookup_closure ()
return SCM_BOOL_F; return SCM_BOOL_F;
} }
SCM_SYMBOL (sym_sys_pre_modules_transformer, "%pre-modules-transformer");
SCM SCM
scm_module_transformer (SCM module) scm_module_transformer (SCM module)
{ {
if (scm_is_false (module)) if (SCM_UNLIKELY (scm_is_false (module)))
return SCM_BOOL_F; { SCM v = scm_hashq_ref (scm_pre_modules_obarray,
sym_sys_pre_modules_transformer,
SCM_BOOL_F);
if (scm_is_false (v))
return SCM_BOOL_F;
else
return SCM_VARIABLE_REF (v);
}
else else
return SCM_MODULE_TRANSFORMER (module); return SCM_MODULE_TRANSFORMER (module);
} }
@ -589,10 +598,7 @@ scm_module_transformer (SCM module)
SCM SCM
scm_current_module_transformer () scm_current_module_transformer ()
{ {
if (scm_module_system_booted_p) return scm_module_transformer (scm_current_module ());
return scm_module_transformer (scm_current_module ());
else
return SCM_BOOL_F;
} }
SCM_DEFINE (scm_module_import_interface, "module-import-interface", 2, 0, 0, SCM_DEFINE (scm_module_import_interface, "module-import-interface", 2, 0, 0,