Common Functions and Macros
The core toolbox for everyday Clojure: mapping/filtering/reducing data, threading, and common macros.
This section is the “you’ll use these daily” list: core functions and macros that show up in almost every Clojure codebase.
If you are translating Java loops, focus on the sequence toolbox (map, filter, reduce) and on threading macros (->, ->>) that make transformation pipelines easy to read.
In this section
-
Sequence Operations
Use map/filter/reduce and friends to build readable data pipelines; most sequence transforms are lazy.
-
Collection Manipulation
The everyday update operations for persistent collections: get/assoc/update/conj plus dissoc/disj/into and nested helpers.
-
Function Composition and Utilities
Build functions from functions with comp/partial/juxt plus apply and memoize for practical pipelines.
-
Threading Macros
Make transformation pipelines readable with ->, ->>, and the conditional threading variants some-> and cond->.
-
Conditional Macros
Everyday branching tools beyond if: when, if-let/when-let, cond, and case (plus the truthiness rules that matter).