[racket] Passing information between syntax classes

From: Konrad Hinsen (konrad.hinsen at fastmail.net)
Date: Thu Feb 12 11:16:18 EST 2015

Greg Hendershott writes:

 > Preface: Whenever I attempt to answer a question about macros, my secret
 > agenda is that I'll be the main beneficiary... from someone else jumping
 > in to correct my answer and teach me. So here goes. :)

Fair enough ;-)

 > Does `bar` need to be a syntax-class? Instead, what if it's just another
 > macro -- that `foo` expands into, passing the set?

Introducing another macro lets me factor out the expansion of "bar",
but not the pattern itself. In my case, it would already yield some
benefits, so I'll keep this solution in mind if nothing better comes up.

But ideally, I would like to factor out the pattern itself, which in
my real application is more complex and consists of several cases.

Thanks,
  Konrad.

Posted on the users mailing list.