5 ms·
See https://clojure.org/about/lisp https://clojure.org/about/lisp for the relationship between clojure and other lisps. Variable capture is a problem with lisp
by spdegabrielle 9y ago
See https://clojure.org/about/lisp https://clojure.org/about/lisp for the relationship between clojure and other lisps.
Variable capture is a problem with lisp macros that lisp and clojure programmers have tools and strategies to manage.
A number or languages use hygienic macros to avoid the variable capture problem: Scheme, Racket, Dylan, Elixir, Rust, Julia & Perl 6 (which has hygienic AND unhygienic macros)
Racket has more advanced macro facilities specifically aimed at making new languages languages and DSLs. Syntax-parse is very interesting in how it addresses the problem of error reporting with macros.
- shakna 9y ago> Scheme, Racket, Dylan, Elixir, Rust, Julia & Perl 6 (which has hygienic AND unhygienic macros) Just want to add that Racket, and most Schemes also support both hygienic and unhygienic macros, through defmacro. [0][1] Though, their use is heavily discouraged. (And it may be worth pointing out that Guile's defmacro is actually implemented using syntax-case, which is hygienic most of the time, but flexible enough to let you do madcap things. [2]). [0] https://docs.racket-lang.org/compatibility/defmacro.html https://docs.racket-lang.org/compatibility/defmacro.html [1] https://www.gnu.org/software/guile/manual/html_node/Defmacros.html https://www.gnu.org/software/guile/manual/html_node/Defmacro... [2] http://stackoverflow.com/a/19666120 http://stackoverflow.com/a/19666120