The Artima Developer Community


Errata for Programming in Scala
Chapter 15: Case Classes and Pattern Matching
Return to errata index.

Page 270 (PDF page 300):
l.1 The default cases uses
-->             case

FIXED
Page 271 (PDF page 301):
Index / Ch.15 Case Clases and Pattern Matching, p.271 [pdf 301]: 
to index entry for "`(backtick)" add "in constants, 271"

DONE
Page 273 (PDF page 303):
A very little mistake:
"You can use a typed pattern as a a". The 'a' is written twice

FIXED
Page 277 (PDF page 307):
the '@'-sign entry in the index should include variable binding as a
sub-entry

DONE
Page 288 (PDF page 318):
Divisions such as "x / (x + 1)"

FIXED
Page 280 (PDF page 320):
It states at the bottom of p280:

"The operators isInstanceOf and asInstanceOf are treated as predefined
methods of class Any..."

Looking at the ScalDoc I see that isInstanceOf and asInstanceOf ARE
methods of Any.

Thus, I would rewrite the above as:

"The operators isInstanceOf and asInstanceOf are predefined methods of
class Any..."

The use of "treated" suggests alias/synonym.
Page 278 (PDF page 325):
At the bottom:

case s: String if s(0) == 'a' => ...

will throw a StringIndexOutOfBoundsException if s == ""

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.