[plt-scheme] Extending macro pattern syntax

From: James Coglan (jcoglan at googlemail.com)
Date: Sat Jan 31 09:05:05 EST 2009

Hi all,

Following on from some macro pattern stuff I've brought up before, I was
wondering whether it's possible to extend the syntax of macro patterns using
Scheme macros? Specifically, is it possible to create your own macro syntax
that would allow ellipses in places other than tail position?

For example, there's no reason the pattern (_ (name value) ... expr) could
not be made to work, since 'expr' is a less specific matcher than '(name
value)'. '(name value) ...' would consume input expressions until it hit a
non-list expression, then 'expr' would take over. So firstly, are there
counterexamples to prove this wouldn't work, and if it would work, can you
implement it using Scheme macros themselves? I'd also like to do something
similar with keywords, so that for example (_ expr ... stop stmt ...) would
work if 'stop' is a keyword for the syntax.

James Coglan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20090131/b2c21789/attachment.html>

Posted on the users mailing list.