[plt-dev] syntax-case error messages

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Mar 29 20:31:00 EDT 2010

At Mon, 29 Mar 2010 18:58:34 -0400, Matthias Felleisen wrote:
> On Mar 29, 2010, at 6:36 PM, Robby Findler wrote:
> > By thisine of reasoning a scheme imlementation that didn't have
> > contracts should change car-of-null error message to say "a function
> > had an error" which seems wrong to me.
> No it would be ideal if it said "function f had an error" instead of "car of 
> null mumbo jumbo". 

Yes, I completely agree with both of you. When I'm implementing `f', I
want the car-of-null error. When I've given `f' to others, I want the
"f has an error" message.

That the default for `check-syntax' is the opposite of the usual one
may be a historical accident; it may be because good syntax-error
checking is usually a lot harder than good function-argument checking;
or it may be that implementing a run-time "f has an error" would be
expensive (i.e., I've never figured out how to implement something like
that efficiently, but I've often wanted it).

And I agree with Jay. At this point, though, the "bad syntax" message
from `syntax-case' is ingrained in our code, in the sense that error
messages would sometimes be worse for end users if we swapped the
default. (I think that "function f had an error" would become ingrained
in our code, too, if that were the default.)

Posted on the dev mailing list.