3 ms·
I’m curious what you mean by “ Clojure uses namespaces in a somewhat clever way to work around the bulk of the hygiene issues you get in CL with defmacro”. CL a
by fiddlerwoaroof 6y ago
I’m curious what you mean by “ Clojure uses namespaces in a somewhat clever way to work around the bulk of the hygiene issues you get in CL with defmacro”. CL and Clojure are, in my experience, basically equivalent here: CL’s solution to hygiene issues is a combination of packages (“namespaces”), gensym. The main difference is that, as a Lisp-2, hygiene issues tend to be easier to avoid because you can’t use LET to shadow functions (which, in my experience writing Clojure, is the most common problem: accidentally declaring a variable called “name”, or similar).
- sjamaan 6y agoBecause Clojure relies so heavily on namespaces, almost all identifiers in a macro's output are going to be fully namespaced already, especially because syntax-quote does this expansion already. Therefore, unintended variable capture is highly unlikely.
- fiddlerwoaroof 6y agoThat’s how CL works too, though.