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 P5.0, released over 2 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
23%
#50212: During Day 2 of Io the reader is suddenly told to "Think of doMessage as somewhat like Ruby's eval". eval however was never mentioned any wher...more...
P5.0
26-Nov-12
25
#50350: In the 3rd paragraph of the "I Won’t Be Your Programming Reference" section, "I will walk you through examples in each languages" should be "I...more...
P5.0
09-Dec-12
32
#50089: You list the "logical operators" | and & as behaving more or less like || and && but without shortcutting. This is incorrect. | and & are t...more...
P1.0
30-Oct-12
35

#50464: In the check out code of Duck Typing when discussing the type system the example
>>a = ['100', 100.0] returns ["100", 100.0] not ['100', 100.0]--IshtarIS

P5.0
13-Jan-13
43
#50102: You describe "methods that test" as those that end in a question mark. I think you can be clearer than that about this Ruby idiom. Specific...more...
P3.0
31-Oct-12
43 45
#49405: The attr keyword defines an instance variable. Several versions exist. The most common are attr (defining an instance variable and a method of...more...
P5.0
04-Jun-12
44

#50080: In the Tree code example, visit_all method, it should say @children.each instead of children.each

P5.0
28-Oct-12
69
#52181: The first paragraph says "Create a list like this" then shows the method 'list'. Then there's a paragraph explaining that there's a shortcu...more...
P5.0
13-Jul-13
72
#53082: In "What We Learned in Day 3" for Io (Chapter 3), it states "Next, we built an XML generator that used /method_missing/ to print XML elements....more...
P5.0
28-Oct-13
83
#53349: The definition of the friend rule works for very simple queries, but gives unexpected results when querying with an unbound variable (e.g. ask...more...
P2.0
14-Dec-13
83
#53110: In the Prolog code for map.pl on page 83, since the three colours are defined as being different through symmetric relations, there seems to b...more...
P5.0
04-Nov-13
97

#76273: Stupid error I know, but it's "Gromit" not "Grommit" - only one 'm' :)--Keith Marshall

P5.0
08-Jan-14
105

#48885: On fourth bullet (line 16) Tail2-2 must read Tail2-B, Tail2 must read Tail2-A--Norbert Müller

P3.0
04-Mar-12
124

#52005: for loop example run as forLoop.scala, but called for_loop.scala on bottom of previous page

P4.0
13-Jun-13
131

#48887: The book translates some Scala to Ruby as:

args.each {|arg| println(arg)}

println isn't a Ruby function so it should be 'puts'--Nigel Lowry

P2.0
04-Mar-12
144
#49230: In section "Classes in Scala": class Person(firstName: String, lastName: String) doesn't result in a class with firstName and lastName attribu...more...
P5.0
29-Apr-12
148
#49231: In scala/employee.scala: Using "override val" for the name attribute in Employee is not necessary. It's easier to write it like this: class...more...
P5.0
29-Apr-12
148
#49232: In scala/employee.scala: "id():String" isn't recommended style, the colon should always be followed by a space. It's right most of the time, b...more...
P5.0
29-Apr-12
150
#48929: In the description of the sort example it is said "that will yield a case-insensitive sort". This is not true as the comparison is only perfo...more...
P3.0
11-Mar-12
152
#51341: (Note that the page# is a guess based on other submissions since I'm reading the Kindle version.) Under "What We Learned in Day 2", in the ...more...
P5.0
19-Apr-13
158
#76905: Inconsistent formatting and syntax highlighting Code example not prefaced with "scala >" prompt val hobbits = Set("frodo", "samwise", "pip...more...
P5.0
26-Jun-14
167
#49148: In the first paragraph of the Scala subsection titled "Concurrency" (bottom of the page numbered 167 on the page in the PDF --- my reader thin...more...
P5.0
19-Apr-12
173
#49449: 4 + "string". "Unlike Scala, there's no coercion between strings and ints." Yes, but the example is misleading since + doesn't concate...more...
P1.0
22-Jun-12
175
#49450: {comic_strip, {name, "Calvin and Hobbes"}, {character, "Spaceman Spiff"}}. "We've represented a hash for a comic strip." ... "If you ar...more...
P1.0
22-Jun-12
215

#49642: Section: Booleans and Expressions

(= 1 1.0) returns false in Clojure 1.3. Is that a language change? (== 1 1.0) does return true.--Jerry Morrison

P1.0
13-Aug-12
219
#50403: Clojure: Under the Booleans and Expressions section, you give an example of (= 1 1.0) and in the example, it evaluates to true. When I run...more...
P5.0
21-Dec-12
232
#49000: In "you’ll define a higher-order function with the fn function", "higher-order" should be "anonymous". Using "fn" always defines an anonymous ...more...
P5.0
27-Mar-12
235
#49643: Section: Infinite Sequences and take Perhaps it's a language change in Clojure 1.3, but the fib-pair example as written gets an ArithmeticE...more...
P1.0
13-Aug-12
238
#48966: On line 4-5 (SomeType.arg) means fire the constructor for SimpleCompass, binding arg to the first parameter. should be (SomeType.arg) m...more...
P3.0
20-Mar-12
249
#76348: Generating the 500th Fibonacci number using the following code: (nth (map first (iterate fib-pair [1 1])) 500) will not work, since the ...more...
P3.0
29-Jan-14
250
#76350: "We grab n elements from the infinite sequence (iterate inc 1). Then we take n of them and multiply them together with apply *." There seem...more...
P3.0
30-Jan-14
251
#49690: One of the titles used in "Working with Atoms" does not match. "Seven Languages" becomes "Seven Languages in Seven Weeks". user=> (swap! to...more...
P5.0
15-Aug-12
252
#76353: You have written: --- You can verify that entering (String. "new string") into the repl returns the new string "new string". --- Enterin...more...
P3.0
31-Jan-14
258
#50849: This page says: "[...] if/then/else statement" and later: "In Haskell, if is a function" Both are wrong -- 'if/then/else' is an e...more...
P1.0
24-Feb-13
260
#50850: "[...] use the let function [...]" let is not a function. "in Haskell, let binds a variable to a function" 'function' should be repla...more...
P1.0
24-Feb-13
261
#76897: foldl1 only takes a function and a list. The example in the middle of the page provides 0 as an initial value to foldl1. Removing the zero mak...more...
P5.0
25-Jun-14
263
#48967: There is a discrepancy between the two implementations of the Fibonacci sequence on pages 262-263 of the UK edition. The 1st fib implement...more...
P4.0
20-Mar-12
267
#50851: "Haskell includes first-class ranges and some syntactic sugar to support them" Ranges are not first-class, they're just sugar for calls to ...more...
P1.0
24-Feb-13
276
#51522: Two issues [page 276-277] The composition operator [pg276] is misused; "foo(bar x)" would be "(foo . bar) x". "(foo x).(bar x)" can be writt...more...
P5.0
15-May-13
277

#50852: "f . g x" is not shorthand for "f (g x)".

Example: "sum . map (+1)" is a valid function. "sum (map (+1))" is a type error.--Matt Fenwick

P1.0
24-Feb-13
279
#49417: Instead of "foldl1 (+) 0 [1 .. 3]" it should either read "foldl (+) 0 [1 .. 3]" or "foldl1 (+) [1 .. 3]" Anyway, it might be a good id...more...
P5.0
08-Jun-12
282

#50853: at the top of the page:

"the types that each statement returns"

Those are expressions, not statements. Also, expressions do not return types.--Matt Fenwick

P1.0
24-Feb-13
282

#50855: "a string is an array of characters [...] represent the array of characters, with an array [...]"

s/array/list/--Matt Fenwick

P1.0
24-Feb-13
282
#50856: "That means that the type Boolean will have a single value, either True or False." I think I get what this is saying, but it's confusing, a...more...
P1.0
24-Feb-13
283

#50854: At the top of the page:

"Suit and Rank are type constructors"

Suit and Rank are not type constructors -- they're types.--Matt Fenwick

P1.0
24-Feb-13
287

#50857: "You can also specify boilerplate implementations."

That should be 'default', not 'boilerplate'.--Matt Fenwick

P1.0
24-Feb-13
289
#50858: "Haskell allows us to chain let expressions together and express the final form in an in statement." The example doesn't show chained let e...more...
P1.0
25-Feb-13
289
#50859: "Monads let you simulate program state." Many monads have nothing to do with state. This seems to imply that monads are only/best for st...more...
P1.0
25-Feb-13
290
#50861: "return wraps up a function into a monad" 'return :: Monad m => a -> m a'. It injects any value, not just functions, into the monad. ...more...
P1.0
25-Feb-13
291
#50860: As mentioned in the 2nd monad law, "m >>= return = m". However, both the treasureMap example on p. 291 and the last example on p. 294 make th...more...
P1.0
25-Feb-13
294
#50862: Just is not a type. It is a function of type ':: a -> Maybe a'. The examples at the top of the page are confusing. They should probably b...more...
P1.0
25-Feb-13
296
#50863: "The fully polymorphic template system" The type system is not a template system. Although there is something separate and unrelated cal...more...
P1.0
25-Feb-13
296

#50864: Haskell's type system is referred to as 'strong' on this page and again on p. 298. It should be 'static'/'statically'.--Matt Fenwick

P1.0
25-Feb-13

Stuff To Be Considered in the Next Edition

PDF Paper Description Found in Fixed in
35
#48024: You say "... class will be much more difficult to debug because Ruby can no longer tell when a method is missing. We would definitely want str...more...
Bruce Tate says: Your design is better than mine. Perhaps in the next edition?
P3.0
23-Nov-11
42
#47508: Figure 2.1 is correct but to make it consistent with the code you show, the three blue boxes on the left should be moved down with the left ar...more...
Bruce Tate says: Good catch. Changes like this are a little bit dangerous and expensive, so I am going to live with this problem and fix it in the next edition, ok?
P3.0
05-Sep-11
92
#47649: In the chapters about Prolog, tuples and list are mentioned. 1. Prolog does not have a real tuple type, and especially not a constant acce...more...
Bruce Tate says: Ah... the danger of writing about a language that is relatively new to me. Unfortunately, this error is pervasive in the chapter, and pretty difficult to fix at this stage. I am going to have to wait until the next edition. Thanks for the catch, and sorry for the error.
P4.0
27-Sep-11
171

#48059: The Fibonacci sequence is defined with the 0th element as 0. The definition on page 171, as another_fib, starts with the 0th element as 1.--Tyler Bindon

Bruce Tate says: You're right, of course. I'm not going to change it here, as the intention is clear enough and I would be likely to inject more errors in the manuscript by fixing the problem. I am going to wait for the next edition to fix this one, ok?
P4.0
28-Nov-11
193
#47401: Immediately after mentioning Erlang is tail recursion optimized, two recursive examples are given - factorial and fibonacci. But neither of th...more...
Bruce Tate says: Good catch. I will revise these in next edition, ok?
P3.0
17-Aug-11
239
#48034: In Hackers and Painters, Graham chronicles a start-up that leveraged produc- tivity with Lisp to achieve productivity that no other vendors co...more...
Bruce Tate says: Good suggestion. Will consider for next edition.
P4.0
25-Nov-11
250
#48060: The Fibonacci sequence is defined with the 0th element as 0. The definition on page 250, as fib, starts with the 0th element as 1. This gives ...more...
Bruce Tate says: Good catch, but I think the intent is clear, and don't want to risk turning a small problem into a bigger one. Will consider for the next release. Thanks for finding this one.
P4.0
28-Nov-11