[racket] macros: nested templates

From: Eric Tanter (etanter at dcc.uchile.cl)
Date: Wed Jul 28 17:11:45 EDT 2010

On Jul 28, 2010, at 4:44 PM, Jon Rafkind wrote:
> You have to escape ellipses like so (... ...). You're pattern would be
> (syntax-case stx ()
>  [(test a (... ...)) #'(list a (... ...))])

Thanks, that works fine.

> Anyway, I don't think what you are doing would work anyway becuase you are trying to unhygienically introduce the `test' macro to expressions inside the body of `FOO'. Your choices are:
> a) use `syntax-local-introduce' to unhygienically add `test'
> b) make the user of `FOO' pass in the `test' name to the macro: (FOO test (test 1 2 3)) and then the macro can bind test in such a way that the body can use it.

My artificial example is distilled from a real example where I do need to break hygiene. And it works (though I use with-syntax and not syntax-local-introduce). 

Thanks again,

-- Éric

Posted on the users mailing list.