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))
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
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.
For example,
(de
Amalie,
Thank you, this is impressive and helpful. I did not know about
syntax-local-value (I also am not certain that I know it now good enough).
However, I did not mean to use the (my-let)'s "definition" of x to pass
information to (access). (Also, can (access y) fail in a customizable
way
syntax-local-value is likely what you'll want to use here. You can bind
your x to a compile-time value that you can access with syntax-local-value.
You can even make that value a struct with #:procedure prop:procedure and
have its procedure be a syntax transformer (so it can expand into something
m
5 matches
Mail list logo