fix some problems with variable-reference->namespace and namespace-attach-module
svn: r7768
This commit is contained in:
parent
e8097b4eaf
commit
24980e41ce
|
@ -3784,11 +3784,6 @@ static Scheme_Object *do_variable_namespace(const char *who, int tl, int argc, S
|
||||||
env = ((Scheme_Bucket_With_Home *)v)->home;
|
env = ((Scheme_Bucket_With_Home *)v)->home;
|
||||||
if (tl && env->module) {
|
if (tl && env->module) {
|
||||||
env = NULL;
|
env = NULL;
|
||||||
} else {
|
|
||||||
ph = env->phase;
|
|
||||||
while (ph--) {
|
|
||||||
env = env->template_env;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3797,7 +3792,25 @@ static Scheme_Object *do_variable_namespace(const char *who, int tl, int argc, S
|
||||||
(tl ? "top-level variable-reference" : "variable-reference"),
|
(tl ? "top-level variable-reference" : "variable-reference"),
|
||||||
0, argc, argv);
|
0, argc, argv);
|
||||||
|
|
||||||
return (Scheme_Object *)make_env(env, 0, 0);
|
ph = env->phase;
|
||||||
|
if (tl) {
|
||||||
|
while (ph--) {
|
||||||
|
env = env->template_env;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
env = make_env(env, 0, 0);
|
||||||
|
|
||||||
|
/* rewind modchain to phase 0: */
|
||||||
|
while (ph--) {
|
||||||
|
v = SCHEME_VEC_ELS(env->modchain)[2];
|
||||||
|
if (SCHEME_FALSEP(v)) {
|
||||||
|
scheme_signal_error("internal error: missing modchain for previous phase");
|
||||||
|
}
|
||||||
|
env->modchain = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (Scheme_Object *)env;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Scheme_Object *variable_namespace(int argc, Scheme_Object *argv[])
|
static Scheme_Object *variable_namespace(int argc, Scheme_Object *argv[])
|
||||||
|
|
|
@ -3115,9 +3115,9 @@ static void show(const char *what, Scheme_Env *menv, int v)
|
||||||
for (i = 0; i < indent; i++) {
|
for (i = 0; i < indent; i++) {
|
||||||
printf(" ");
|
printf(" ");
|
||||||
}
|
}
|
||||||
printf("%s \t%s @%ld [%d]\n",
|
printf("%s \t%s @%ld [%d] %p\n",
|
||||||
what, scheme_write_to_string(menv->module->modname, NULL),
|
what, scheme_write_to_string(menv->module->modname, NULL),
|
||||||
menv->phase, v);
|
menv->phase, v, menv->modchain);
|
||||||
indent++;
|
indent++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3614,6 +3614,7 @@ static void eval_module_body(Scheme_Env *menv)
|
||||||
int volatile save_phase_shift;
|
int volatile save_phase_shift;
|
||||||
mz_jmp_buf newbuf, * volatile savebuf;
|
mz_jmp_buf newbuf, * volatile savebuf;
|
||||||
|
|
||||||
|
menv->running = 1;
|
||||||
menv->ran = 1;
|
menv->ran = 1;
|
||||||
|
|
||||||
depth = m->max_let_depth + scheme_prefix_depth(m->prefix);
|
depth = m->max_let_depth + scheme_prefix_depth(m->prefix);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user