May 2018
Beginner to intermediate
290 pages
6h 43m
English
Having introduced you to the eval function, let me now give you a critical bit of advice: don’t use it. At least not for real, at least not now—not while you are just learning Clojure. The eval function is an incredibly useful tool to have lying around, but it’s also something of a blunt instrument. Just how blunt? Think about the difference between writing this into your Clojure program:
| | (+ 1 1) |
and this:
| | (eval '(+ 1 1)) |
The first, straightforward, bit of code adds two numbers together. If it’s part of a Clojure application then it will get compiled once and it’s the compiled version that will get fired off at runtime. The second rendition of the code will also get compiled once, but it’s the call to eval, along with ...
Read now
Unlock full access