on third thought, it's module->namespace that needs to prepare the compile time, not dynamic-require, and that's why it worked before; restored the visit-availing behavior of module->namespace, and rewound the previous change (still for PR 10185)
svn: r14455
This commit is contained in:
parent
8c9bcd50c2
commit
fd9ee204a5
|
@ -331,10 +331,9 @@ relative to @scheme[current-load-relative-directory] and/or
|
||||||
@scheme[current-directory].
|
@scheme[current-directory].
|
||||||
|
|
||||||
If @scheme[provided] is @scheme[#f], then the result is @|void-const|,
|
If @scheme[provided] is @scheme[#f], then the result is @|void-const|,
|
||||||
and the module is not @tech{visit}ed (see @secref["mod-parse"]) in
|
and the module is not @tech{visit}ed (see @secref["mod-parse"]) or
|
||||||
phases above the @tech{base phase}, although it is made
|
even made @tech{available} (for on-demand @tech{visits}) in phases
|
||||||
@tech{available} for on-demand @tech{visits}.
|
above the @tech{base phase}.
|
||||||
|
|
||||||
|
|
||||||
When @scheme[provided] is a symbol, the value of the module's export
|
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
|
with the given name is returned, and still the module is not
|
||||||
|
|
|
@ -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
|
indirectly) is also recorded in the current namespace's @tech{module
|
||||||
registry}, and instances at the same @tech{phase} or lower are also
|
registry}, and instances at the same @tech{phase} or lower are also
|
||||||
attached to @scheme[dest-namespace] (while @tech{visits} at the
|
attached to @scheme[dest-namespace] (while @tech{visits} at the
|
||||||
module's phase and instances at higher phases are not attached, although it is
|
module's phase and instances at higher phases are not attached, nor
|
||||||
made @tech{available} for on-demand @tech{visits}). The inspector
|
even made @tech{available} for on-demand @tech{visits}). The inspector
|
||||||
of the module invocation in @scheme[dest-namespace] is the same as
|
of the module invocation in @scheme[dest-namespace] is the same as
|
||||||
inspector of the invocation in @scheme[src-namespace].
|
inspector of the invocation in @scheme[src-namespace].
|
||||||
|
|
||||||
|
|
|
@ -124,8 +124,6 @@ static void eval_exptime(Scheme_Object *names, int count,
|
||||||
|
|
||||||
static Scheme_Module_Exports *make_module_exports();
|
static Scheme_Module_Exports *make_module_exports();
|
||||||
|
|
||||||
XFORM_NONGCING static void should_run_for_compile(Scheme_Env *menv);
|
|
||||||
|
|
||||||
#define cons scheme_make_pair
|
#define cons scheme_make_pair
|
||||||
|
|
||||||
|
|
||||||
|
@ -893,7 +891,7 @@ static Scheme_Object *_dynamic_require(int argc, Scheme_Object *argv[],
|
||||||
if (!phase) {
|
if (!phase) {
|
||||||
/* Evaluate id in a fresh namespace */
|
/* Evaluate id in a fresh namespace */
|
||||||
Scheme_Object *a[3], *ns;
|
Scheme_Object *a[3], *ns;
|
||||||
start_module(m, env, 0, modidx, -1, 1, base_phase, scheme_null);
|
start_module(m, env, 0, modidx, 0, 1, base_phase, scheme_null);
|
||||||
a[0] = scheme_intern_symbol("empty");
|
a[0] = scheme_intern_symbol("empty");
|
||||||
ns = scheme_make_namespace(1, a);
|
ns = scheme_make_namespace(1, a);
|
||||||
a[0] = (Scheme_Object *)env;
|
a[0] = (Scheme_Object *)env;
|
||||||
|
@ -986,7 +984,7 @@ static Scheme_Object *_dynamic_require(int argc, Scheme_Object *argv[],
|
||||||
if (SCHEME_VOIDP(name))
|
if (SCHEME_VOIDP(name))
|
||||||
start_module(m, env, 0, modidx, 1, 0, base_phase, scheme_null);
|
start_module(m, env, 0, modidx, 1, 0, base_phase, scheme_null);
|
||||||
else
|
else
|
||||||
start_module(m, env, 0, modidx, -1, 1, base_phase, scheme_null);
|
start_module(m, env, 0, modidx, 0, 1, base_phase, scheme_null);
|
||||||
|
|
||||||
if (SCHEME_SYMBOLP(name)) {
|
if (SCHEME_SYMBOLP(name)) {
|
||||||
Scheme_Bucket *b;
|
Scheme_Bucket *b;
|
||||||
|
@ -1690,9 +1688,6 @@ static Scheme_Object *namespace_attach_module(int argc, Scheme_Object *argv[])
|
||||||
|
|
||||||
check_phase(menv2, NULL, phase);
|
check_phase(menv2, NULL, phase);
|
||||||
scheme_hash_set(MODCHAIN_TABLE(to_modchain), name, (Scheme_Object *)menv2);
|
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->module_registry, name, (Scheme_Object *)menv->module);
|
||||||
scheme_hash_set(to_env->export_registry, name, (Scheme_Object *)menv->module->me);
|
scheme_hash_set(to_env->export_registry, name, (Scheme_Object *)menv->module->me);
|
||||||
|
@ -2371,6 +2366,7 @@ static int add_simple_require_renames(Scheme_Object *orig_src,
|
||||||
void scheme_prep_namespace_rename(Scheme_Env *menv)
|
void scheme_prep_namespace_rename(Scheme_Env *menv)
|
||||||
{
|
{
|
||||||
scheme_prepare_exp_env(menv);
|
scheme_prepare_exp_env(menv);
|
||||||
|
start_module(menv->module, menv, 0, NULL, -1, 1, menv->phase, scheme_null);
|
||||||
|
|
||||||
if (!menv->rename_set_ready) {
|
if (!menv->rename_set_ready) {
|
||||||
if (menv->module->rn_stx) {
|
if (menv->module->rn_stx) {
|
||||||
|
@ -3986,7 +3982,7 @@ static void do_start_module(Scheme_Module *m, Scheme_Env *menv, Scheme_Env *env,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XFORM_NONGCING static void should_run_for_compile(Scheme_Env *menv)
|
static void should_run_for_compile(Scheme_Env *menv)
|
||||||
{
|
{
|
||||||
if (!menv->available_next[0]) {
|
if (!menv->available_next[0]) {
|
||||||
menv->available_next[0] = MODCHAIN_AVAIL(menv->modchain, 0);
|
menv->available_next[0] = MODCHAIN_AVAIL(menv->modchain, 0);
|
||||||
|
@ -4692,9 +4688,7 @@ module_execute(Scheme_Object *data)
|
||||||
|
|
||||||
/* Replacing an already-running or already-syntaxing module? */
|
/* Replacing an already-running or already-syntaxing module? */
|
||||||
if (old_menv) {
|
if (old_menv) {
|
||||||
start_module(m, env, 1, NULL,
|
start_module(m, env, 1, NULL, 0, (old_menv->running > 0) ? 1 : 0, env->phase, scheme_null);
|
||||||
(old_menv->et_running ? 1 : 0), (old_menv->running > 0) ? 1 : 0,
|
|
||||||
env->phase, scheme_null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return scheme_void;
|
return scheme_void;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user