[racket-dev] syntax parsing: must be a nice pattern-y way to do this
I want to apply a transformation to a nested pattern element.
To start with, suppose I have a (kind of useless) with-handlers that looks like this:
(with-syntax
([((arg ...) ...)
#`((clause.input ...) ...)])
et-cetera)
That is, I've basically just renamed "clause.input" to "arg".
But now, I want to perform some transformation on the elements. I'd like to write this:
(with-syntax
([((arg ...) ...)
#`((#,(transform #'clause.input) ...) ...)])
et-cetera)
.. but this fails, with the error "new-style-signals.rkt:42:30: syntax: missing ellipsis with pattern variable in template in: clause.input"
I can certainly work around this, by abandoning the pattern-matching slickness and just using a bunch of syntax->lists, but it seems like there must be a nicer way. Am I missing some nifty trick?
John
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4800 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20120916/d4887430/attachment.p7s>