Oh, syntax-parameter-value has helped.

#lang racket

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

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

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

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

(save
 (begin
   (save
    (access))))


it prints

my-info = '(new-info new-info)
'ok


Seems to be exactly what I was looking for. Thanks for help!


Best regards,

Dmitry

--
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to