Notation Conventions

The following notation conventions are used throughout the book.

Literal code examples use the following font:

 (+ 2 2)

The result of executing a code example is preceded by ->.

 (+ 2 2)
 -> 4

Where console output cannot easily be distinguished from code and results, it’s preceded by a pipe character (|).

 (println ​"hello"​)
 | hello
 -> nil

When introducing a Clojure form for the first time, we’ll show the grammar for the form like this:

 (example-fn required-arg)
 (example-fn optional-arg?)
 (example-fn zero-or-more-arg*)
 (example-fn one-or-more-arg+)
 (example-fn & collection-of-variable-args)

The grammar is informal, using ?, *, +, and & to document different argument-passing styles, as shown previously.

Clojure ...

Get Programming Clojure, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.