[plt-dev] slightly misleading error

From: John Clements (clements at brinckerhoff.org)
Date: Fri May 22 14:52:32 EDT 2009

On May 22, 2009, at 11:48 AM, Dave Herman wrote:

> This code:
>    (define (foo) (values 'a 'b))
>    (let ([x (foo)]) x)
> highlights the expression (values 'a 'b) and produces the error  
> message:
>    context expected 1 value, received 2 values: a b
> The highlighted expression was the producer, but the message was  
> about the context. This confused me when it happened to me, because  
> I assumed the highlighted expression /was/ the context, and set  
> about hopelessly trying to figure out what *inside* that expression  
> had produced the wrong number of values.
> This is one of those "two parties disagree but there's no expressed  
> contract" kinds of errors, so highlighting either party is  
> reasonable, but the error message should probably be consistent with  
> what's highlighted in order to avoid this confusion.

Could you fix this by just changing the error message to

"context of this expression expected 1 value, received 2 values: a b"



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2484 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20090522/7cab6230/attachment.p7s>

Posted on the dev mailing list.