[plt-scheme] How to write context-aware macros?

From: Simon Haines (con.amalgamate at gmail.com)
Date: Fri Oct 23 01:52:55 EDT 2009

I'd like some advice for implementing related macros that share some
kind of context. The example I'd like to emulate is (in clojure):

In this example, I assume the behaviour of redis/ping, redis/get and
redis/set differ based on the first form supplied to redis/with-
server. Is this possible with scheme? The scheme wiki (http://
community.schemewiki.org/?scheme-faq-macros) says that sub-macros are
not possible (in R5RS), but that somehow the sub-macros may be
implemented with let-syntax forms. How might this be achieved? If it
is possible, what are the caveats? Thanks.

Posted on the users mailing list.