[racket] Introduction to syntax-parse

From: Konrad Hinsen (konrad.hinsen at fastmail.net)
Date: Wed Sep 25 02:14:47 EDT 2013

Stephen Chang writes:

 > You need (require (for-syntax syntax/parse)) because you are using it inside a
 > define-syntax.

Aaaaahhh... that does it, thanks!

Laurent writes:

 > How much work would be required to prevent people from falling into it ever again?
 > Maybe saying so in the docs at the right place wouldn't hurt, but people may still miss
 > it.

That's my case. The line (require (for-syntax syntax/parse)) is just
above the example, but on a quick scan I just see "require", so I type
the more familiar (require syntax/parse).

 > Maybe making the error message more specific like "Did you forget to (require
 > (for-syntax syntax/parse)) ?" ? Or is it too specific?

It would already help a lot if the error message said something about
syntax-parse being undefined. But it complains about the pattern,
which is kind of strange. It looks like syntax-parse is already there
but incomplete.

Konrad.

Posted on the users mailing list.