[racket-dev] very unhelpful beginner language error message, possible fix proposed

From: David Van Horn (dvanhorn at ccs.neu.edu)
Date: Mon Feb 13 17:07:23 EST 2012

On 2/13/12 4:20 PM, Stephen Bloch wrote:
>
> On Feb 13, 2012, at 8:28 AM, David Van Horn wrote:
>
>> In BSL, you can detect when the first element of a clause is a variable bound to a function, but I don't follow the reasoning about ISL.  You can't distinguish good from bad uses without running the code because you can't tell if a name refers to a function or a non-function.
>
> Not reliably, because the student COULD be using a parameter or a local variable in that position.  But in the COMMON case of this error, the student will use a predefined function or an explicitly user-defined top-level function, and it should be possible to recognize those at syntax-check-time.

But even if the name is a parameter, it cannot be bound to a function. 
If it's a local, it either is or isn't a function -- you can tell from 
the definition.

I think it's correct to consider this a syntax error, not a run-time 
error.  It should just have a better message.

> Which leaves
>
>> cond: question result is not true or false: (lambda (a1) ...)
>
> as a good error message to report at run time in the rare cases that don't match the above description.

Except you don't want to say lambda in BSL.

David

Posted on the dev mailing list.