Chapter 3. Controlling Program Flow


As a functional language, functions are the beginning and end of every Clojure program. The "shape" of any Clojure program is like a tree, each function branching out and calling other functions. Understanding a Clojure program means understanding its functions and the patterns in which they are called. Use functions carelessly and your Clojure programs will be incomprehensible spaghetti. Use them thoughtfully and your Clojure programs will be fast, elegant, and a genuine joy both to write and to read.

First-Class Functions

In Clojure, all functions are first-class objects. This means the following:

  • They can be dynamically created at any point during the execution of the program.

  • They aren't intrinsically ...

Get Practical Clojure now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.