Clojure is a modern functional Lisp dialect that runs on the Java Virtual Machine, JavaScript engines (ClojureScript), and the .NET CLR. Unlike traditional object-oriented languages, Clojure treats immutable, persistent data structures as first-class citizens and provides powerful concurrency primitives that eliminate the need for explicit locking. The language embraces a REPL-driven development workflow where code is iteratively built and tested in a live environment, dramatically shortening the feedback loop. One key mental model: in Clojure, functions compose data transformations rather than mutating stateβthis shift from "place-oriented programming" to "value-oriented programming" makes parallel execution safe by default and greatly simplifies reasoning about program behavior.
What This Cheat Sheet Covers
This topic spans 29 focused tables and 259 indexed concepts, 180 flashcards. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
A jump-to index of every table row in this cheat sheet.
An interactive map of every table and concept in this topic.
Table 1: Core Data Structures
These are the literal building blocks you'll reach for constantly β vectors, lists, maps, and sets each have their own reader syntax (the [ ], ' ( ), { }, #{ } notations) and a distinct performance profile. Keywords and symbols round out the set: keywords are the idiomatic map keys and enum-like values, while symbols name the vars and functions your code refers to.
| Structure | Example | Description | |
|---|---|---|---|
[1 2 3](vector 1 2 3) | β’ Indexed collection with fast random access at any position β’ conj adds to end. | ||
'(1 2 3)(list 1 2 3) | β’ Linked list optimized for sequential access from head β’ conj adds to front. | ||
{:a 1 :b 2}(hash-map :a 1 :b 2) | β’ Key-value pairs with fast lookup β’ keys are typically keywords | ||
#{1 2 3}(hash-set 1 2 3) | Unordered collection of unique values with fast membership testing. | ||
:name::local-keyword | β’ Self-evaluating identifier commonly used as map keys and enums β’ fast equality checks | ||
'my-varuser/my-fn | β’ Names that refer to vars or functions β’ typically require quoting to prevent evaluation |