Symbols Are Things

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 ...

Get Getting Clojure now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.