Sorry. It is probably better to ignore the part about the second syntax-case clause for now. I didn't provide the necessary background to make sense of it. Once I get past my current problem it probably won't be relevant anyway. I'm currently hitting the unbound identifier error in both clauses so if I fix the first one I should be able to fix the second one. And the first one is the simpler case.
On Tuesday, May 28, 2019 at 12:41:43 AM UTC-4, Greg Hendershott wrote: > > 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/e8720196-863b-43ab-adef-65bf6f20a985%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

