[racket] using new (~a ...) form for errors: minor irritation?

From: John Clements (clements at brinckerhoff.org)
Date: Thu Nov 8 12:48:50 EST 2012

I'm really enjoying the new (~a ...) formatting forms, but I'm wondering about a workaround for this minor irritation:

When I call (error...), I typically use the form that includes the function name. However, this form treats its second argument as a format string, not as a message. This means that if I want to use this form, I have to write:

(error 'my-proc "~a" (~a "You messed up, "name"."))

I suppose I could use the more concise:

(error (~a "my-proc: You messed up,"name"."))

... but I feel like I'm losing information by gluing the function name into the message prematurely.

Am I missing something obvious? Aside from just using raise-argument-error more often?

John

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4370 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20121108/d1d16269/attachment.p7s>

Posted on the users mailing list.