[plt-scheme] how to quote identifier in macro

From: Noel Welsh (noelwelsh at gmail.com)
Date: Sat Dec 13 07:45:33 EST 2008

I don't have time right now to work out the full solution, so here's a
sketch of what you need to do:

1. Make attr available at expansion time.  Do this using
define-for-syntax instead of define

2. Map over attr generating the syntax you want to splice into the
expansion.  Introduce the result using with-syntax

So something like:

(define-for-syntax attr '(a1 a2 a3))

(define-syntax ...
  [(_ a (s ps ...) expr ...)
   (with-syntax ([(attr-id ...) (process-attr (syntax a))])
     (syntax ...))])


Posted on the users mailing list.