[racket] syntax-parse and literals

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Fri Sep 2 23:10:05 EDT 2011

On Fri, Sep 2, 2011 at 9:50 PM, Shriram Krishnamurthi <sk at cs.brown.edu> wrote:
> I guess to me, the term "literal identifier" is an oxymoron.  It's
> either a literal (5, #f, in this case :) or an identifier (foo, car,
> +).  Unless "identifier" means nothing more or less than "symbol".
> When I write (:) in syntax-case, I'm saying ": is not a binding form;
> I want to see literally a :, and I don't want to bind the : in the
> pattern to whatever you find in that position".  I'm trying to
> reproduce that effect here.

You don't want the code you've written, then (and as Asumu pointed
out, there is the ~datum pattern). But as others have argued, "scoped
keywords" seem to have worked better for us in general (I'm forgetting
the series of examples that get us there tho). That is, the
syntax-parse error message is actually accurate in that case and the
fix is not to change the error message, but to change the macro.
(Hopefully that clarifies a little bit.)


Posted on the users mailing list.