May 2018
Beginner to intermediate
290 pages
6h 43m
English
Surprisingly, the bindings between symbols and values, the things created by def, are also ordinary values. When you evaluate a def, Clojure creates a var, a thing that represents the binding between a symbol and a value. As illustrated in the figure, you can think of vars as having two slots: there’s a place for the symbol (maybe author) and a place for the value (perhaps "Austen").

In a lovely bit of introspection, you can also get at a var with the proper incantation, this time a # followed by a ’:
| | (def author "Austen") ; Make a var. |
| | |
| | #'author ; Get at the var for author -> "Austen". |
Like any other Clojure ...
Read now
Unlock full access