If users of your `named-query` macro will supply the name as an identifier -- an unquoted symbol like some-name in this example:
(named-query (name-line (_ 0) (_ "name") some-name)) Then what your macro needs to do with the pattern variable is... just use it -- as is -- in the template. (It is already a piece of syntax that could be a valid identifier. You're all set.) If the idea is that users will supply the name as a string like "some-name", then yes your macro would need to do the (string->symbol (syntax->datum #'magic-name)) thing you already have -- but *also* convert that result back to syntax: (datum->syntax #'magic-name (string->symbol (syntax->datum #'magic-name))) p.s. That (datum->syntax _ (string->symbol (syntax->datum _))) triplet has an equivalent handy shortcut -- `format-id`: (format-id #'magic-name "~a" #'magic-name) p.p.s. I had similar questions before and wrote this: <https://www.greghendershott.com/fear-of-macros/pattern-matching.html> -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/87lfyr8f0q.fsf%40greghendershott.com. For more options, visit https://groups.google.com/d/optout.