February 2018
Intermediate to advanced
304 pages
7h 11m
English
In this section, we’ll cover many of the key parts of Clojure syntax and how they’re used to form Clojure programs. In Clojure, there are no statements, only expressions that can be nested in mostly arbitrary ways. When evaluated, every expression returns a value that’s used in the parent expression. This is a simple model, yet sufficient to cover everything in Clojure.
To begin our exploration, let’s consider a simple arithmetic expression as expressed in Clojure:
| | (+ 2 3) |
| | -> 5 |
All Clojure code is made up of expressions, and every expression, when evaluated, returns a value. In Clojure, parentheses are used to indicate a list, in this example, a list containing the symbol + and the numbers 2 and 3.
Clojure’s runtime ...