diff --git a/collects/drscheme/private/module-language.ss b/collects/drscheme/private/module-language.ss index 7d8f0d14fe..da8dc8ebc9 100644 --- a/collects/drscheme/private/module-language.ss +++ b/collects/drscheme/private/module-language.ss @@ -234,11 +234,7 @@ (parameterize ([current-namespace (current-namespace)]) ;; the prompt makes it continue after an error (call-with-continuation-prompt - (λ () - ;; instantiate compile time: - (dynamic-require modspec (void)) - ;; instantiate run time: - (dynamic-require modspec #f)))) + (λ () (dynamic-require modspec #f)))) (current-namespace (module->namespace modspec)) (check-interactive-language)) ;; here's where they're all combined with the module expression diff --git a/collects/scribblings/reference/module-reflect.scrbl b/collects/scribblings/reference/module-reflect.scrbl index 941f6fa03a..9cc29909a8 100644 --- a/collects/scribblings/reference/module-reflect.scrbl +++ b/collects/scribblings/reference/module-reflect.scrbl @@ -331,9 +331,10 @@ relative to @scheme[current-load-relative-directory] and/or @scheme[current-directory]. If @scheme[provided] is @scheme[#f], then the result is @|void-const|, -and the module is not @tech{visit}ed (see @secref["mod-parse"]) or -even made @tech{available} (for on-demand @tech{visits}) in phases -above the @tech{base phase}. +and the module is not @tech{visit}ed (see @secref["mod-parse"]) in +phases above the @tech{base phase}, although it is made +@tech{available} for on-demand @tech{visits}. + When @scheme[provided] is a symbol, the value of the module's export with the given name is returned, and still the module is not diff --git a/collects/scribblings/reference/namespaces.scrbl b/collects/scribblings/reference/namespaces.scrbl index 27e2732f01..3401fea453 100644 --- a/collects/scribblings/reference/namespaces.scrbl +++ b/collects/scribblings/reference/namespaces.scrbl @@ -254,8 +254,8 @@ is used as the module name in @scheme[dest-namespace]. In addition to indirectly) is also recorded in the current namespace's @tech{module registry}, and instances at the same @tech{phase} or lower are also attached to @scheme[dest-namespace] (while @tech{visits} at the -module's phase and instances at higher phases are not attached, nor -even made @tech{available} for on-demand @tech{visits}). The inspector +module's phase and instances at higher phases are not attached, although it is +made @tech{available} for on-demand @tech{visits}). The inspector of the module invocation in @scheme[dest-namespace] is the same as inspector of the invocation in @scheme[src-namespace]. diff --git a/src/mzscheme/src/module.c b/src/mzscheme/src/module.c index 2dc67e932c..b8a1339964 100644 --- a/src/mzscheme/src/module.c +++ b/src/mzscheme/src/module.c @@ -124,6 +124,8 @@ static void eval_exptime(Scheme_Object *names, int count, static Scheme_Module_Exports *make_module_exports(); +XFORM_NONGCING static void should_run_for_compile(Scheme_Env *menv); + #define cons scheme_make_pair @@ -891,7 +893,7 @@ static Scheme_Object *_dynamic_require(int argc, Scheme_Object *argv[], if (!phase) { /* Evaluate id in a fresh namespace */ Scheme_Object *a[3], *ns; - start_module(m, env, 0, modidx, 0, 1, base_phase, scheme_null); + start_module(m, env, 0, modidx, -1, 1, base_phase, scheme_null); a[0] = scheme_intern_symbol("empty"); ns = scheme_make_namespace(1, a); a[0] = (Scheme_Object *)env; @@ -984,7 +986,7 @@ static Scheme_Object *_dynamic_require(int argc, Scheme_Object *argv[], if (SCHEME_VOIDP(name)) start_module(m, env, 0, modidx, 1, 0, base_phase, scheme_null); else - start_module(m, env, 0, modidx, 0, 1, base_phase, scheme_null); + start_module(m, env, 0, modidx, -1, 1, base_phase, scheme_null); if (SCHEME_SYMBOLP(name)) { Scheme_Bucket *b; @@ -1688,6 +1690,9 @@ static Scheme_Object *namespace_attach_module(int argc, Scheme_Object *argv[]) check_phase(menv2, NULL, phase); scheme_hash_set(MODCHAIN_TABLE(to_modchain), name, (Scheme_Object *)menv2); + if (menv2->phase > orig_phase) { + should_run_for_compile(menv2); + } } scheme_hash_set(to_env->module_registry, name, (Scheme_Object *)menv->module); scheme_hash_set(to_env->export_registry, name, (Scheme_Object *)menv->module->me); @@ -3981,7 +3986,7 @@ static void do_start_module(Scheme_Module *m, Scheme_Env *menv, Scheme_Env *env, } } -static void should_run_for_compile(Scheme_Env *menv) +XFORM_NONGCING static void should_run_for_compile(Scheme_Env *menv) { if (!menv->available_next[0]) { menv->available_next[0] = MODCHAIN_AVAIL(menv->modchain, 0); @@ -4687,7 +4692,9 @@ module_execute(Scheme_Object *data) /* Replacing an already-running or already-syntaxing module? */ if (old_menv) { - start_module(m, env, 1, NULL, 0, (old_menv->running > 0) ? 1 : 0, env->phase, scheme_null); + start_module(m, env, 1, NULL, + (old_menv->et_running ? 1 : 0), (old_menv->running > 0) ? 1 : 0, + env->phase, scheme_null); } return scheme_void;