[racket-dev] teaching language error messages

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Tue Jul 19 13:08:12 EDT 2011

On Tue, Jul 19, 2011 at 12:03 PM, Guillaume Marceau <gmarceau at gmail.com> wrote:
> On Tue, Jul 19, 2011 at 12:03 PM, Robby Findler
> <robby at eecs.northwestern.edu> wrote:
>> I see that the teaching language error messages now have things like
>> this in them (where the . is an image literal):
>> Welcome to DrRacket, version [3m].
>> Language: Beginning Student; memory limit: 128 MB.
>> > (+ 1 (list .))
>> +: expects a number as 2nd argument, given (cons an image empty)
>> I see that this is being done via regexps on the error message
>> strings. This seems bad.
>> Can we at least get some delimiters on there so it doesn't look like a
>> malformed use of 'cons'?
> My goal is to have the actual image displayed there instead. "an image" was
> just a quick replacement for #(struct:object:cache-image-snip% ...), which
> is incomprehensible to students, and intimidating.
> I've push a fix that makes it read (cons (image) empty) instead. That should
> hold us up until we get a proper image there.

Okay. I'll push a change to the error messages that hopefully
demonstrates a better technique for implementing things like this than
regexp munging of the error strings.


Posted on the dev mailing list.