Replace index-based loops with recursion, reduce, and loop/recur where needed.
Java developers often reach for for loops out of habit: indexes, mutable accumulators, and in-place updates. In Clojure, the default tools are different—most iteration becomes sequence transformation, and explicit looping is expressed with reduce or loop/recur.
This chapter shows you how to think in terms of data flow instead of control flow. When you do need a “real loop,” you will learn the Clojure primitives that make it explicit and safe, without hiding mutation behind clever tricks.
The goal is not to write recursive code everywhere; it is to stop fighting the language and choose the simplest iteration shape for the problem.