May 2018
Beginner to intermediate
290 pages
6h 43m
English
But what exactly is the it that is part of the environment? In other words, what does def do, precisely? The answer is implicit in the terminology: We say that def binds a symbol to a value. The thing to note here is that the word symbol is not just Clojure jargon for what most other languages call an identifier. The reason it’s not just jargon is that symbols are first-class takes up bytes in memory values in Clojure, similar to strings and keywords. So this expression:
| | (def author "Austen") |
involves two values: the string "Austen" and the symbol author.
Symbols have a lot in common with keywords: both are just strings of characters that are meaningful to humans. And both symbols and keywords stand for some value. The ...
Read now
Unlock full access