Errata

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-ns exists in the joy.ch2 namespace”

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? x y) 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* h function 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 genclass should be removed from the "Eat Cheetos" example.

Resources

  • Page 317: should be “Norvig, Peter 1998.”

Thanks to everyone who submitted these corrections.

33 Responses

  1. Bernhard Groll says:

    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”.

  2. artg says:

    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.

  3. Edward Cho says:

    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.

  4. Steve Zhang says:

    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.

  5. Edward Cho says:

    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

  6. artg says:

    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

  7. Sean Nilan says:

    On page 223 (print version 2011), I believe that that the “>” should be replaced with “<” in the code halfway down the page.

  8. Stefan Hallerstede says:

    On page 41, bottom: should be “(:refer joy.ch2 On page 42, top: should be “(:refer joy.ch2 …

  9. artg says:

    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.

  10. Adrian Mouat says:

    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.

  11. Topher says:

    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″.

  12. Topher says:

    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))”

  13. Jiří Maršík says:

    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.

    • Jiří Maršík says:

      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.

  14. Adrian Mouat says:

    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).

  15. Jay Vyas says:

    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

  16. Earl Jenkins says:

    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

  17. Ksheerasagar Akella says:

    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.

  18. Ksheerasagar Akella says:

    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

  19. Ksheerasagar Akella says:

    Section 2.9.4 (Creating mappings with :refer)

    Second line of code should be (:refer joy.ch2)) instead of (:refer joy.ch1))

  20. Peter Suter says:

    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”

Leave a Reply

*