Hi guys,
Suppose I have a macro that computes a value and then calls another macro in
its template. Is there a way to share that data with the 2nd macro without
passing it as an argument?
Thanks!
Kevin
--
You received this message because you are subscribed to the Google Groups
"Racke
You can use syntax-local-value to communicate across macros.
Here's an example:
https://docs.racket-lang.org/syntax-parse-example/index.html?q=cross-macro#(mod-path._syntax-parse-example%2Fcross-macro-communication%2Fcross-macro-communication)
On 10/21/20, Kevin Forchione wrote:
> Hi guys
> On Oct 21, 2020, at 10:33 AM, William G Hatch wrote:
>
> On Wed, Oct 21, 2020 at 10:07:12AM -0700, Kevin Forchione wrote:
>> Hi guys,
>> Suppose I have a macro that computes a value and then calls another macro in
>> its template. Is there a way to share that data with the 2nd macro wi
>
> Here’s a toy example. It generates an error, but hopefully conveys the idea
> I’m trying to express.
>
> #lang racket
>
> (require (for-syntax syntax/parse)
> racket/stxparam
> racket/stxparam-exptime)
>
> (define-syntax-parameter mval 1)
>
> (define-syntax (foo stx)
>
4 matches
Mail list logo