Forms

Clojure is homoiconic,[16] which is to say that Clojure code is composed of Clojure data. When you run a Clojure program, a part of Clojure called the reader reads the text of the program in chunks called forms and translates them into Clojure data structures. Clojure then compiles and executes the data structures.

The Clojure forms covered in this book are summarized in the following table.

FormExample(s)

Primary Coverage

Boolean true, false

Booleans and nil

Character \a

Strings and Characters

Keyword :tag, :doc

Maps, Keywords, and Records

List (1 2 3), (println "foo")

Chapter 3, Unifying Data with Sequences

Map {:name "Bill", :age 42}

Maps, Keywords, and Records

Nil nil

Booleans and nil

Number 1, 4.2

Using Numeric Types

Set #{:snap ...

Get Programming Clojure, 2nd 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.