Browse Clojure Foundations for Java Developers

The Concept of Recursion

Recursion is defining a problem in terms of smaller versions of itself, with a base case.

Recursion is a way to define a computation in terms of smaller computations of the same shape. Every recursive definition needs two parts:

  • a base case (when to stop)
  • a step that reduces the problem toward the base case

If you are coming from Java, you probably associate recursion with algorithms class and stack overflows. In Clojure, recursion is still a real tool, but you will also learn safer iteration shapes (reduce, loop/recur) and a strong preference for transforming sequences instead of managing indexes.

The goal of this section is to make recursion feel like a clear design pattern rather than a risky trick.

In this section

Revised on Friday, April 24, 2026