summaryrefslogtreecommitdiff
path: root/libguile/modules.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2009-03-09 20:49:54 +0100
committerAndy Wingo <wingo@pobox.com>2009-04-21 23:02:17 +0200
commitb7e6589fff9fe85c46519ba20d45bf599ea56ffd (patch)
treeb35abf16bffe4179827bae7a4dcad79deaf16b9f /libguile/modules.c
parentdec62b5ef8f03c17f95a89a38c27128b10a41f28 (diff)
downloadguile-b7e6589fff9fe85c46519ba20d45bf599ea56ffd.tar.gz
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.
Diffstat (limited to 'libguile/modules.c')
-rw-r--r--libguile/modules.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/libguile/modules.c b/libguile/modules.c
index 428cb607d..2cb8a7620 100644
--- a/libguile/modules.c
+++ b/libguile/modules.c
@@ -577,11 +577,20 @@ scm_current_module_lookup_closure ()
return SCM_BOOL_F;
}
+SCM_SYMBOL (sym_sys_pre_modules_transformer, "%pre-modules-transformer");
+
SCM
scm_module_transformer (SCM module)
{
- if (scm_is_false (module))
- return SCM_BOOL_F;
+ if (SCM_UNLIKELY (scm_is_false (module)))
+ { 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
return SCM_MODULE_TRANSFORMER (module);
}
@@ -589,10 +598,7 @@ scm_module_transformer (SCM module)
SCM
scm_current_module_transformer ()
{
- if (scm_module_system_booted_p)
- return scm_module_transformer (scm_current_module ());
- else
- return SCM_BOOL_F;
+ return scm_module_transformer (scm_current_module ());
}
SCM_DEFINE (scm_module_import_interface, "module-import-interface", 2, 0, 0,