[racket] Abstract datum literal out of syntax class

From: Jonathan Schuster (schuster at ccs.neu.edu)
Date: Mon Feb 17 16:24:52 EST 2014

Is there a way to abstract datum literals out of a (splicing) syntax class?
I have a number of patterns that look something like this:

(~optional (clause-name: element ...))

and I'd like to factor that out into a common syntax class, but be able to
specialize it according to the specific clause name I'm expecting. For
example, instead of something like this:

(~optional (my-clause: element ...))

I would have a syntax class called "maybe-clause" and just write

(~var clause (maybe-clause my-clause:))

Is this possible?

P.S. I know that I should be using literals instead of datum literals, but
that's a refactoring that needs to happen to this code later on. In any
case, I assume one has the same problems with literals, too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140217/4e43070d/attachment.html>

Posted on the users mailing list.