[racket] Again on bindings visibility in eval

From: Thomas Chust (chust at web.de)
Date: Thu Jul 14 07:35:17 EDT 2011

Markku Rontu wrote:
> [...]
> On the topic of macros, I find it a bit confusing that to metaprogram in
> Racket, I must use such a different language of macros (with
> syntax-rules et al.), instead of being able to manipulate common data
> structures with plain old Racket functions.
> [...]


this is not really true. The domain specific languages of syntax-rules
and syntax-case macro transformers exist purely for your convenience.
You can always manipulate syntax objects directly, all the necessary
procedures are available and documented in section 11 of the Racket
reference manual.

> [...]
> The approach in Clojure,
> that the code is just a common data structure, easily manipulatable with
> Clojure code, is intriguing.
> [...]

The approach taken by Clojure and Common Lisp looks simple but lacks
support for hygienic macros and is therefore error prone and actually
not at all simple, if not impossible, to use correctly.

While Clojure *mitigates* the problems of non-hygienic macros using
namespaces and a shorthand syntax for freshly generated identifiers, it
doesn't *solve* the problems. Racket's macro system, on the other hand,
does solve the problems and since that involves some heavy lifting, it
may seem more complicated at first glance.


When C++ is your hammer, every problem looks like your thumb.

Posted on the users mailing list.