You can "pass" information from one macro to another by binding information to an identifier defined to be a syntax parameter that both macros have in scope. You would need to functionally update its value for each rebinding. Its value would be retrievable with syntax-local-value.

Like this, am I close? I tried to make a shortest possible example.
But it does not work as I expected: it prints "my-info = #<set!-transformer>" rather than '(new-info).

#lang racket

(require (for-syntax syntax/parse syntax/transformer)

(define-syntax-parameter my-info '())

(define-syntax (access stx)
  (syntax-parse stx
     (printf "my-info = ~v\n" (syntax-local-value #'my-info))

(define-syntax (save stx)
  (syntax-parse stx
    [(_ body:expr)
     #'(syntax-parameterize ((my-info
                              (cons 'new-info (syntax-local-value #'my-info))))


Best regards,


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 
For more options, visit

Reply via email to