One more adjustment that maps 1,0,-1 to "syntax", "runtime", "template"
respectively.
On 01/21/2010 10:23 AM, Jon Rafkind wrote:
Attached is a patch to do basically this. I haven't erased references
to 'transformer', though.
On 01/20/2010 06:28 PM, Jon Rafkind wrote:
Could the error message for unbound identifiers always give the
phase? As a corollary I dislike the name 'transformer environment'.
So instead of:
compile: unbound identifier in module (transformer environment)
in: take
-->
compile: unbound identifier in module (phase 1) in: take
And in phase 2 I don't get any special indication at all (like
'transformer environment').
compile: unbound identifier in module in: take
-->
compile: unbound identifier in module (phase 2) in: take
Maybe 'phase 0' could be elided during that phase since its the most
common thing and people probably don't want to see it.
_________________________________________________
For list-related administrative tasks:
http://list.cs.brown.edu/mailman/listinfo/plt-dev
Index: eval.c
===================================================================
--- eval.c (revision 17724)
+++ eval.c (working copy)
@@ -6993,20 +6993,29 @@
if (env->genv->disallow_unbound) {
if (bad || !scheme_lookup_in_table(env->genv->toplevel, (const char *)SCHEME_STX_SYM(c))) {
GC_CAN_IGNORE const char *reason;
+ GC_CAN_IGNORE const char *which_phase;
+ switch (env->genv->phase){
+ case 1 : which_phase = " `syntax'"; break;
+ case 0 : which_phase = " `runtime'"; break;
+ case -1: which_phase = " `template'"; break;
+ default : which_phase = ""; break;
+ }
if (env->genv->phase == 1) {
- reason = "unbound identifier in module (transformer environment)";
+ reason = "unbound identifier in module (transformer environment at phase %d%s)";
/* Check in the run-time environment */
if (scheme_lookup_in_table(env->genv->template_env->toplevel, (const char *)SCHEME_STX_SYM(c))) {
reason = ("unbound identifier in module (in the transformer environment, which does"
- " not include the run-time definition)");
+ " not include the run-time definition at phase %d%s)");
} else if (env->genv->template_env->syntax
&& scheme_lookup_in_table(env->genv->template_env->syntax, (const char *)SCHEME_STX_SYM(c))) {
reason = ("unbound identifier in module (in the transformer environment, which does"
- " not include the macro definition that is visible to run-time expressions)");
+ " not include the macro definition that is visible to run-time expressions at phase %d%s)");
}
- } else
- reason = "unbound identifier in module";
- scheme_wrong_syntax(when, NULL, c, reason);
+ } else {
+ reason = "unbound identifier in module (at phase %d%s)";
+ }
+
+ scheme_wrong_syntax(when, NULL, c, reason, env->genv->phase, which_phase);
}
}
}
_________________________________________________
For list-related administrative tasks:
http://list.cs.brown.edu/mailman/listinfo/plt-dev