small medium large xlarge

Errata for Programming Scala

 

The latest version of the book is P1.0, released over 6 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.

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:

If you've found a new error, please submit it.

  • Typo
  • Tech. error
  • Suggestion
  • Maybe next edition
  • Not a problem
  • Reported in: P1.0 (20-Oct-13)
#53040
PDF page: 16
the receiveWithin call inside getTopStock returns a RuntimeException. See: issues.scala-lang.org/browse/SI-5460 Using: Scala version 2.10.2 (J...more...
  • Reported in: P1.0 (20-Aug-09)
#40517
PDF page: 38
The text in chapter: Getting up to speed in Scala (excerpt), page #38, specifies, "So, calling 1 to 3 is equivalent to 1.to(3), but the former is more...more...
  • Reported in: P1.0 (11-Nov-11)
#47936
PDF page: 40

The words "do for" in the code snippet is overstriked. Is that a typo?--Kirin

  • Reported in: P1.0 (01-Nov-09)
#41155
PDF page: 49
It is not evident (at least not to me) that the Protected.scala examples cannot be run from the interpreter. Since this is the first time in the book ...more...
  • Reported in: P1.0 (10-Sep-11)
#47538
Paper page: 52
Marker.scala does not compile on Scala 2.9. <console>:10: error: constructor Marker in class Marker cannot be accessed in object Marker ...more...
  • Reported in: P1.0 (08-Jul-11)
#47256
Paper page: 61
The code sample (SensibleTyping/Methods.scala) does not work as either a stand-alone script or when the code is transplanted to a class. In either sce...more...
  • Reported in: P1.0 (28-Nov-11)
#48066
PDF page: 64
It seems that in Generics.scala more is shown than is intended. I suspect that var list1 : List[Int] = new ArrayList[Int] was really meant to ...more...
  • Reported in: P1.0 (03-Jan-10)
#41988
PDF page: 65
Footnote 4. reads: "Equivalent Java code will compile with no errors but result in a runtime ClassCastException." I think it is not true. Java equi...more...
  • Reported in: B3.0 (01-Jun-09)
#39295
PDF page: 68
"Unfortunately, the way we’re used to is not a idiomatic way to define methods in Scala." It should be "an idiomatic way". Notice the "an" vs. "a".-...more...
  • Reported in: P1.0 (29-Nov-11)
#48068
PDF page: 69
The code for Methods.scala does not work as expected and produces runtime errors, at least with scala 2.9.1 and IcedTea7 2.0 on Ubuntu. Specificall...more...
  • Reported in: B3.0 (23-Jun-09)
#39631
PDF page: 71
your where you is appropriate. "But, your protest, the method is benign." probably should be... "But, you protest, the method is benign."--blaine w...more...
  • Reported in: P1.0 (28-Aug-09)
#40585
PDF page: 84
The author forgot to include the "var" in front of the repeated "max" example statements. These lines will not execute as written but will after the ...more...
  • Reported in: B3.0 (23-Jun-09)
#39613
PDF page: 88

"instance given tous" -> "instance given to us"--Kai Virkki

  • Reported in: B3.0 (23-Jun-09)
#39614
PDF page: 90

"in the code previous" -> "in the previous code"--Kai Virkki

  • Reported in: B3.0 (23-Jun-09)
#39615
PDF page: 94
When testing the code examples I noticed that you have to be extra careful to leave an empty line after "def helpAsFriend(friend: Friend) = friend lis...more...
  • Reported in: P1.0 (13-Jan-11)
#46231
PDF page: 97

The employment application example creates a value with a name of "emplomentApplication". There is a missing Y in this name.

  • Reported in: B3.0 (23-Jun-09)
#39616
PDF page: 98

"val emplomentApplication" -> "val employmentApplication"--Kai Virkki

  • Reported in: P1.0 (19-Jan-10)
#42111
PDF page: 111

The Scala alternate method for foldRight is actually :\ and not \: as written.--rboyd

  • Reported in: P1.0 (27-Dec-09)
#41932
Paper page: 111

'plus the literal "done."' -> 'plus the literal "done".'
'does not match "done," then' -> 'does not match "done", then'--Jan Voges

  • Reported in: P1.0 (27-Dec-09)
#41933
Paper page: 118

"SYMBOL:PRICE." -> "SYMBOL:PRICE".
--Jan Voges

  • Reported in: P1.0 (27-Dec-09)
#41934
Paper page: 119

"SYMBOL:PRICE." -> "SYMBOL:PRICE".
A running gag ;-) --Jan Voges

  • Reported in: P1.0 (27-Dec-09)
#41935
Paper page: 123

"GOOG," -> "GOOG",
The last for today --Jan Voges

  • Reported in: P1.0 (25-Dec-12)
#50414
Paper page: 132
mailboxSize is never not 0. As I'm still learning Scala, I'm not quite able to figure out why from the source though given this book is now 4+ years ...more...
  • Reported in: P1.0 (07-Jul-10)
#44002
Paper page: 135

10.5: ... about explicitly staring an actor...
should be
... about explicitly starting an actor... --Hans-Peter Keilhofer

  • Reported in: P1.0 (13-Sep-10)
#45003
Paper page: 139
You write, that if the TIMEOUT object is not pattern matched, an exception is thrown. I have tested this with Scala 2.8.0 and there no exception is th...more...
  • Reported in: P1.0 (14-Jan-11)
#46239
PDF page: 141

explicitly staring an actor" should be "explicitly starting an actor

  • Reported in: P1.0 (28-Dec-12)
#50418
PDF page: 141

"You can restart the actor, if you like, by calling the start( ) method." - This is not possible.--Robert Slifka

  • Reported in: P1.0 (15-Dec-10)
#46010
Paper page: 164

Text references java.util.AraryList instead of java.util.ArrayList--Jamie Paulson

  • Reported in: P1.0 (15-Dec-10)
#46011
Paper page: 170
In the ExpectExample code snippet, the code comment states that "The above exception is wrong", it seems that this should say "The above expectation i...more...
  • Reported in: P1.0 (22-Nov-09)
#41591
PDF page: 197
The Code example UsingScala/StockPriceFinder uses java.util.Date().getYear. This method on Date is deprecated and does not return the date in the expe...more...