It seemed like most of your question was about creating the name identifier for the `define`. I focused on (and hopefully answered) that part. But I didn't pick up on what you said the error message was:
>> attempts to use with-syntax* also fail with errors like "modified-rst: >> unbound identifier in module (in phase 1, transformer environment)". So, this part isn't about `magic-name`. It's about `modified-rst` in your second clause: (define-syntax (named-query stx) (syntax-case stx (name-line) [(_ (name-line (_ 0) (_ "name") magic-name)) (with-syntax ([name (string->symbol (syntax->datum #'magic-name))]) #'(define name (lambda () (void))))] [(_ (name-line (_ 0) (_ "name") magic-name) . rst) (with-syntax ([name (string->symbol (syntax->datum #'magic-name))] [modified-rst (cons (datum->syntax #'rst always-true-line) #'rst)]) #'(define name (lambda () (query . modified-rst))))])) A few things: 1. The invocation you mentioned: >> The macro invocation will look something like this: >> >> (named-query >> (name-line (offset 0) (name-type "name") "tga-image")) doesn't seem to match that second clause? So I'm not sure how that invocation is giving you that error message. Is it actually some other invocation example? 2. I don't see where `always-true-line` comes from. Where is that defined? What kind of values will it have? 3. Could you say more about what you're trying to do here? `(cons (datum->syntax #'rst always-true-line) #'rst)` -- 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/87k1eb8a2j.fsf%40greghendershott.com. For more options, visit https://groups.google.com/d/optout.