The Joy of Clojure: Thinking the Clojure Way by Michael Fogus Chris Houser

The Joy of Clojure: Thinking the Clojure Way by Michael Fogus Chris Houser

Author:Michael Fogus, Chris Houser
Language: eng
Format: epub
Publisher: Manning Publications


In section 1.5.6, we mentioned quoting and its effects on evaluation, and in this chapter we’ll expand on that theme fully as it relates to Clojure’s macro facility. But the functionality of the quoting forms is orthogonal to macros, and they can be used independently. As we show[3] in listing 8.1, using quoting and unquoting in a function allows us to create an evaluation function, contextual-eval, that takes an explicit context map. Rarely will you see the use of syntax-quote outside the body of a macro, but there’s nothing preventing it from being used this way—and doing so is powerful. But the maximum power of quoting forms is fully realized when used with macros.

3 Thanks to George Jahad for the implementation on which contextual-eval is based.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.