[racket] keep bindings in unhygienic macros?

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Tue Jul 19 14:34:23 EDT 2011

On Tue, Jul 19, 2011 at 2:06 PM, Ismael Figueroa Palet
<ifigueroap at gmail.com> wrote:
> Hi all, I'm trying to implement some simple macros to use monads in racket
> using a Haskell-like do notation. I have the following macros, and my
> problem is that I want the do macro to capture the bind identifier created
> by with-monad, and in each recursive step of the do macro expansion keep the
> same identifier. I don't know it is possible, I tried using (with-syntax
> ((bind (datum->syntax 'bind) ))) but it doesn't work.

I think the right solution here is to use syntax parameters [1].  This
blog post by Eli provides a good intro:

[1] http://docs.racket-lang.org/reference/stxparam.html
sam th
samth at ccs.neu.edu

Posted on the users mailing list.