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)
@@ -6994,19 +6994,21 @@
 	if (bad || !scheme_lookup_in_table(env->genv->toplevel, (const char *)SCHEME_STX_SYM(c))) {
           GC_CAN_IGNORE const char *reason;
           if (env->genv->phase == 1) {
-            reason = "unbound identifier in module (transformer environment)";
+            reason = "unbound identifier in module (transformer environment at phase %d)";
             /* 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)");
             } 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)");
             }
-          } else
-            reason = "unbound identifier in module";
-	  scheme_wrong_syntax(when, NULL, c, reason);
+          } else {
+            reason = "unbound identifier in module (at phase %d)";
+          }
+
+	  scheme_wrong_syntax(when, NULL, c, reason, env->genv->phase);
 	}
       }
     }
_________________________________________________
  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-dev

Reply via email to