The Artima Developer Community


Errata for Programming in Scala, 2nd Edition
Chapter 16: Working with Lists
Return to errata index.

Page 309 (PDF page 348):
Typo in gray box (line 12): “Indeed there is such _as_ class”
Page 315 (PDF page 354):
"You will see in Section 4 how to speed it up."

We're already in Section 16.6. The reference must be wrong?
Page 327 (PDF page 366):
Last paragraph, first sentence, first part:
"For associative operations, fold left and fold right are equivalent"
should be "For commutative associative operations, fold left and fold
right are equivalent".

Counter example for the statement as it stands:
scala> ( "START" /: words) ( _ + _ )
res10: String = STARTthequickbrownfox

scala> (words :\ "START" ) ( _ + _ )
res11: String = thequickbrownfoxSTART
Page 328 (PDF page 367):
Intro: While discussing type inference for fold methods, the books gives
a forward reference, which leads to the wrong chapter.

Text: "To find out why the type inferencer goes wrong, you’ll need to
know about the types of the fold methods and how they are implemented.
More on this in Chapter 22."

Problem: However, folds are not even discussed in chapter 22, and the
issue is discussed much earlier, in section 16.10.

Fix: Please replace last sentence of the quoted text with: "More on this
in Section 16.10."

Page number: Book type: Paperback book PDF eBook
Book version: (Or build date. Found on back of title page.)
Your feedback:
Your name: (optional)
Your email address: (optional) (will not be published)

Copyright © 2021 Artima, Inc. All rights reserved.