We try to keep our books accurate, but sometimes mistakes creep in. This page lists the errors submitted by our astute readers. If you've found a new error, please submit it.

The latest version of the book is P3.0, released almost 4 years ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.

Key: Typo Tech. Error Suggestion Not a problem Next edition

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:  

(To find out what version you have, look at the copyright page, a few pages in from the front of the book. If it says (say) 'Second Printing', then here it'll be P2.0. If there are interim PDF releases in that printing, they'll be 2.1, 2.2, and so on.)

PDF Paper Description Found in Fixed in
Title
#41259: The "Version of Book With Error" combo box on the "Add Erratum for Programming Clojure" webpage (i.e. the page I am filling this out on) state...more...
P2.0
08-Nov-09
27
#44272: This is about "cond". I got the impression that Clojure supports the Common Lisp cond form (with parentheses). But when I tried typing the exa...more...
P3.0
25-Jul-10
36

#44902: The if in a comment block is colored.

P3.0
07-Sep-10
38

#47328: The example near the top of the page is (take 10 examples.introduction/fibs). The actual expression should be (take 10 (examples.introduction/fibs)).--Larry Jones

P3.0
01-Aug-11
38
#47329: Sorry. The other examples using fibs on this page are also incorrect. The text on the pages is (take 10 fibs). The example should be (take ...more...
P3.0
01-Aug-11
39

#46622: For for anonymous function using implicit parameter names is "(#body)". Should be "#(body)".--Havvy

P1.0
20-Mar-11
39
#45434: In the first anonymous fn example, "A fine day" string is used. Instead, to be consistent with other examples nearby, "A fine day it is" ough...more...
P2.0
25-Oct-10
39
#47330: The example near the bottom of the page defines the function "hello" in the namespace examples.introduction. This function was also defined on...more...
P3.0
01-Aug-11
40

#47331: I believe the "source" function is now defined is clojure.repl.--Larry Jones

P3.0
01-Aug-11
41

#47268: (show java.util.HashMap) did not work--Steven Schermerhorn

P3.0
17-Jul-11
52

#41743: In the definition of index-filter, what is the purpose of the outer when? --Vraj Mohan

Stuart Halloway says: Prevent NullPointerExceptions when passed nil.
P1.0
07-Dec-09
52
#46099: In the second example of the use of index-filter: (index-filter #{\a \b} "xyz") should the return value be "()" (an empty list) instead ...more...
P1.0
23-Dec-10
52
#41693: This may be a misunderstanding on my part, but for the code example: [code] (defn index-filter [pred coll] (when pred (for [[idx ...more...
Stuart Halloway says: I believe the existing text is simple and accurate.
P2.0
03-Dec-09
57
#47336: On page 56, we define the function "greeting" in the file exploring.clj. On page 57, we redefine the function "greeting" to accept multiple ar...more...
P3.0
02-Aug-11
59
#47337: On page 58, we define "indexable-words?" as a top-level function. On page 59, we reuse that name but bind it to a locally defined function. ...more...
P3.0
02-Aug-11
73
#47362: On page 73, we define a function named describe-class. This function clashes with the version defined on the previous page. If we want to main...more...
P3.0
11-Aug-11
74
#42316: The phrase, metadata is "data about data", is technically incorrect. Although it is more common in English to do so, the preferred is still t...more...
Stuart Halloway says: Author's choice.
P2.0
16-Feb-10
75
#45354: The metadata reader macros described have been deprecated with the release of Clojure 1.2 -- '^' is now used to attach metadata to objects (wi...more...
P3.0
12-Oct-10
78
#47364: On page 77, we provide sample code for reader/tasklist.clj. On page 78, we then shift to example/tasklist.clj. For several minutes, I thought ...more...
P3.0
11-Aug-11
84

#47365: We define class-available? near the middle of the page and then we redefine it a paragraph later.--Larry Jones

P3.0
11-Aug-11
92
#47832: Code example at bottom of page reads: (parse (java.io.File. "examples/sequences/compositions.xml")) However, the proper path to composit...more...
P2.0
27-Oct-11
97

#45731: The text states, "The interesting part is the :gen-classform...."

I believe it should read ":gen-class form".
--Larry Jones

P3.0
23-Nov-10
106
#47381: On this page, we define the symbol x twice. When I was first entering this data myself, I did not (since I'd just defined x). When I entered t...more...
P3.0
14-Aug-11
122
#47213: It says: "To see a non-true match, try using some with identity to find the first non-nil value in a sequence: (some identity [nil false 1 ni...more...
P3.0
22-Jun-11
153
#47215: Unsure if my previous attempt to submit this worked as it complained about use of a hyperlink. There's a problem with the typesetting of the k...more...
P3.0
23-Jun-11
171 151
#46442: Under subheading, "Replacing Recursion with Laziness," (replace '((a b) (((b g r) (f r)) c (d e)) b) 'b 'a) is shown to be returning: ...more...
P2.0
22-Feb-11
189

#41296: Line 8 of the runonce code has a nil that looks like it can be omitted.--art gittleman

Stuart Halloway says: Returning nil prevents reset-fn from exposing implementation details.
P1.0
10-Nov-09
203
#47473: When I tried the examples on this page, the Clojure repl reported an error: user=> (let [a 1 b 2] (broken-bench (+ a b))) java.lang.Except...more...
P3.0
31-Aug-11
208
#41574: The definition of println-once should be (def println-once (create-runonce println)) as in was in the first printing assuming the code for r...more...
Stuart Halloway says: This is not a problem once #41579 is fixed. Thanks!
P2.0
19-Nov-09
208

#41428: (function) should be (apply function args)
This was reported for v. 1.0 but not yet corrected.--art gittleman

Stuart Halloway says: This is not a problem once #41579 is fixed. Thanks!
P2.0
14-Nov-09
209

#41297: line 8 of the runonce code has a nil that could be omitted.--art gittleman

Stuart Halloway says: Returning nil prevents reset-fn from exposing implementation details.
P2.0
10-Nov-09
223 203
#41568: The example shows what would happen if Clojure allowed unqualified symbols "start" and "result" in a macro. The example continues with "start"...more...
Stuart Halloway says: The macro trumps the let binding, not the other way around. Try it and see.
P2.0
19-Nov-09
223
#41111: When talking about auto-gensym, the "try it" example is `foo#. The font in the PDF makes this appear like 'foo#. Copying gives the correct b...more...
P2.0
26-Oct-09
236

#45328: A normal quote is used in the first listing of deftarget rather than a back-quote.--Dale Thatcher

P3.0
10-Oct-10

Stuff To Be Considered in the Next Edition

PDF Paper Description Found in Fixed in
23

#41023: In
(use 'lancet)
where is lancet? The code does not load as is.
Also 'lancet.ant.
--art gittleman

Stuart Halloway says: This example code showing lancet usage is not intended to be run at this point in the book. To see where lancet has gone since the book has been published, see http://github.com/technomancy/leiningen
P1.0
19-Oct-09
31
#41857: The remark about "following the *nix instructions" for Cygwin is not accurate. From a Cygwin shell, the repl.sh script does not work. You must...more...
P2.0
17-Dec-09
36
#40813: In the example of redefining the hello function to be hello-with-memory, the text says you can verify the new functionality by typing (hello "...more...
Stuart Halloway says: This is a good point for the next edition.
P1.0
20-Sep-09