Maybe this book is perfect? Apparently not quite. We’ll continue to post errata as it arrives.
Chapter 1
- Page 17: should be
(joy.chess/lookup (joy.chess/initial-board) "a1")
Chapter 2
- Page 40: should be “
report-nsexists in thejoy.ch2namespace”
Chapter 3
- Page 51, Section 3.4: should be “from one to the other”
- Page 52: Regular expressions are covered in section 4.5, page 73
Chapter 4
- Page 71, Section 4.4: should be “when evaluated in the
(identical? xy)form”
Chapter 5
- Page 85, Listing 5.1: The last line of the listing should be:
(map #(vec(map + yx %))deltas))))
Chapter 7
- Page 153: note the errata from page 85 above
- Section 7.4: The A*
hfunction uses a very high weighted value to estimate path cost. As a result, the examples presented provide estimations that are too pessimistic.
Chapter 8
- Page 160: quoting was introduced in section 2.6, page 32
- Page 163: quoting was introduced in section 2.6, page 32
Chapter 9
- Page 192: should be
(TreeNode. 5 nil nil)(not(TreeNodePlus 5 nil nil))
Chapter 10
- Page 217: the word
genclassshould be removed from the"Eat Cheetos"example.
Resources
- Page 317: should be “Norvig, Peter 1998.”
Thanks to everyone who submitted these corrections.
On page 131 (section 7.1.3) the docstring for the functions keys-apply and manip-map is after the args vector. Is it intentional ?
It was not intentional, but thankfully it doesn’t break anything. :-)
Page 84, Table 5.1: The entry for “If the index is out of range” and “get” should be “Returns ‘not found’ or nil” instead of “Returns nil”.
On Page 182, Figure 9.4, the folder “impl” should be named “contracts”
Thanks!
In Listing 5.2 on p. 101 “when (seq s)” could just be “when s” because (next s) in the recur will be nil if there are no more elements.
After the 10.4 and 10.5 listings for joy.gui.socks, it may be helpful to include a (def gui (joy.gui.DynaFrame. “Socks”)) with the first REPL snippet on page 250.
Page 303, 13.3 “The book describes 24 software best practices…” should be “23 software best practices…”, since there are only 23 patterns in the GoF book.
11.8.1 ppvalues (pg. 301)
The REPL snippet seems to be incorrect. If it only costs as much as the most expensive element calculated, which should be (sleeper 3 :2nd) at ~3000 msecs.
This is my REPL output: joy.mutation> (-> (pvs) last time) “Elapsed time: 3000.521 msecs” :3rd
11.9.4 Dynamic scope (pg. 306)
s/with-binding/with-precision/ after the map example.
At the bottom of p. 128 I had trouble applying the test. I changed the function to (defn ^{:test (fn [] (assert (= (join “,” [1,2,3]) “1,3,3″)))} join [sep s] (apply str (interpose sep s)))
and the test to
(test #’join)
“test” is in clojure.core now
In the last line, there should be 2 ) instead of 3 ).
(str (nth guys-whole-name 2) “, ” (nth guys-whole-name 0) ” ” (nth guys-whole-name 1)))
Page 46, link for more information on Cljr is: http://github.com/fogus/cljr. Looks like it should be http://github.com/liebke/cljr
On page 140 of Section 7.2, “(- 1 bearing-num)” should be “(- bearing-num 1)” for the definitions for both bot and mirror-bot.
On page 223 (print version 2011), I believe that that the “>” should be replaced with “<” in the code halfway down the page.
On page 41, with respect to name clashes: typically the odds decrease as the chances increase.
On page 41, bottom: should be “(:refer joy.ch2 On page 42, top: should be “(:refer joy.ch2 …
On p. 244 I have some questions. You use commute in move-piece which works fine and then change to use commute in update-to-move which does not work properly. However if you leave move-piece using alter then commute works in update-to-move. Both move-piece and update-to-move are in the same transaction so the transaction seems to work as long as one function uses ‘alter’. Also it wouldn’t make sense for the board to change in a different order than the to-move vector even if both showed one k and one K.
On page 181, consider changing “…for Clojure namespaces and not part of…” to “…for Clojure namespaces and is not part of…”.
On page 178, I find figure 9.1 a bit confusing. I wonder if it originally mirrored a listing that was changed? Should joy.nc/authors be joy.ns/authors? I would like more context for the ‘Date prefix as well.
On page 150, the first sentence of the last para doesn’t seem to agree with the listing. It says: “From the y-x point [0 0] the cost of travelling 5 right and 5 down given an estimated cost step-cost-est is 9000.” Should it be “… step-cost-est of 900 is 7200″? Possibly I’ve just misunderstood what it’s trying to say though.
Any, great book, best programming book I’ve read in a long time!
Regards,
Adrian.
The last code block of page 41 also incorrectly refers to the namespace “joy.ch1″. The “:refer” call should be to “joy.ch2″.
In the last code block on page 41, “(:refer joy.ch1)” should be “(:refer joy.ch2)”
It’s output should be “The current namespace is joy.yet-another”, not “The current namespace is $”. This is consistent with the output found on page 39 (ie: “The current namespace is joy.ch2″).
Also, the next code block (the first on page 42) refers to joy.ch1. “:refer joy.ch1″ should be “:refer joy.ch2″.
There is an extra closing paren in the code block in the middle of page 47. “guys-whole-name 1)))” should be “guys-whole-name 1))”
In several places of Section 11.2, (board-map #(dosync (deref %)) board) should probably be replaced by (dosync (board-map deref board)).
The former starts a new transaction for retrieving the value of every square of the board, something which has shown to produce inconsistent views of the board when I make each thread do 100x the work they were doing before.
Errata for my errata: By making them do more work, I meant that the threads are still working while I am capturing the various snapshots, not that more iterations leave the board in an inconsistent state after finishing.
Page 231, in the footnote: the Groovy operator is
?.(not.?).I’m a little confused by Fig 11.4 (pg 243) and the main body text. The figure shows what happens to the num-moves ref, but the main body text talks about square references – did the figure example get out of sync with the text example (or vice versa)?
(It’s not overly important as both examples make the same point).
Very minor, but in Figure 11.5 pg 244, the figure shows the value a’, but the text talks about a?.
Another extremely minor one: pg 247 includes the text “growing one step large each time” – I guess it should be “larger”.
Hi great book . Thanks for the in depth treatment of collections…
Another error —>
On Page 89 it sais something akin to :
“see section 5.5″
However the Queues section is in 5.4.1
Bottom of page 21 chapter 2 on Scalars footnote 1 explains continued coverage of Regex noting section 4.6 but Regex actually begins at section 4.5
Section 2.8.1 (A little pitch and catch)
The try form is inside a pair of square brackets … looks like a mistake. The same code works fine without them.
Section 2.9.1 (Creating namespaces using ns)
Last para first line: This is because report-ns exists in the joy.ch1 namespace…
should be changed to joy.ch2
Section 2.9.4 (Creating mappings with :refer)
Second line of code should be (:refer joy.ch2)) instead of (:refer joy.ch1))
Page 110: “becuase” should be “because” Page 127: “by instead proving” should be “by instead providing” Page 127: “to the return of the function” should be “to the return value of the function”