Programming Scala

Errata for Programming Scala

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
PDF
Page 8
Installing Scala

What is the Scala version is described in the Book, is it really 2.7.5? “The examples used in this book were written and compiled using Scala version 2.7.5.final, the latest release at the time of this writing, and “nightly builds” of Scala version 2.8.0, which may be finalized by the time you read this.” Excerpt From: Dean Wampler and Alex Payne. “Programming Scala.” iBooks.

Note from the Author or Editor:
This is a paragraph from the first edition, not the second edition.

Alex  Jun 22, 2014 
PDF
Page 16
6th (second to last)

"Because map takes a single function argument, where the function itself takes a single argument." is a clause. I think removing the leading "Because" will fix it.

Note from the Author or Editor:
Yes, change "Because" to "The".

Chris Simpkins  Aug 23, 2014 
PDF
Page 18
1st paragraph, 4th line

s/imaging/imagine/

Note from the Author or Editor:
correct

Chris Simpkins  Aug 23, 2014 
PDF
Page 21
code section 3rd paragraph

scala> import progscala2.introscala.shapes._ import progscala2.introscala.shapes._ scala> val p00 = new Point p00: progscala2.introscala.shapes.Point = Point(0.0,0.0) scala> val p20 = new Point(2.0) p20: progscala2.introscala.shapes.Point = Point(2.0,0.0) scala> val p20b = new Point(2.0) p20b: progscala2.introscala.shapes.Point = Point(2.0,0.0) scala> val p02 = new Point(y = 2.0) p02: progscala2.introscala.shapes.Point = Point(0.0,2.0) scala> p00 == p20 res0: Boolean = false scala> p20 == p20b res1: Boolean = true

Note from the Author or Editor:
Correct. The initial import statement and the "echo" on the next line should have "progscala2." prefixes. I found some other mistakes like this that I'll email to the production team, as well.

Vincent Ohprecio  Aug 31, 2014 
PDF
Page 22
2nd paragraph, last sentence

s/to to/to do/

Note from the Author or Editor:
correct.

Chris Simpkins  Aug 23, 2014 
PDF
Page 34
First line

s/can want to/can/

Note from the Author or Editor:
Doh! correct

Chris Simpkins  Aug 24, 2014 
PDF
Page 46
Code Example

On page 46, line 5 (excluding white spaces) of the formatted code example should be p.age and not p.lastName

Note from the Author or Editor:
Correct. It should be "p.age". Copy, paste error...

Ajeya Vempati  Jun 01, 2014 
PDF
Page 50
5th Paragraph

In the section, "Methods with Multiple Argument Lists", in page 51, the author starts the last paragraph with "The third advantage ...". Am I missing another advantage #2? I am assuming advantage #1 is being able to use the 'syntactic sugar' advantage of being able to use '{}' vs '()'.

Note from the Author or Editor:
Yes, no explicit "second" advantage is mentioned. I've "renumbered" them to have a total of 3, not 4.

Anonymous  Jun 01, 2014 
PDF
Page 55
3rd Paragraph

The last sentence in paragraph 3 reads as "Fortunately, Java 8 finally adds clojures to Java.". I think, this is what the author meant "Fortunately, Java 8 finally adds closures to Java."

Note from the Author or Editor:
Doh! Yes, "closures" is the correct work.

Anonymous  Jun 01, 2014 
PDF
Page 60
First line under heading Option, Some, and None: Avoiding nulls

s/three useful type/three useful types/ (add an 's' to "type").

Note from the Author or Editor:
Correct.

Chris Simpkins  Aug 24, 2014 
PDF
Page 98
source code - object manage

In code snippet of apply manage val/val error. Resource close never because symbol 'res' define two time in different scope: var res: Option[R] = None // first time as mutable val res = Some(resource) // second time as immutable in try scope... In 'finally' scope using 'var res' which is never 'None'.

Note from the Author or Editor:
Correct. The "val res = Some... should not have the "val". Fixed in the next early-access release.

Andrew Rochev  Aug 12, 2014 
PDF
Page 132
Result of code snippet

This string "list double" is in result of code snippet page 132. But this string in not in code. It is copy past error.

Note from the Author or Editor:
Correct. Will fix in final version.

Andrew Rochev  Jul 23, 2014 
PDF
Page 152
end of page and beginning of page 153

Just a suggestion: instead of using Int and String as the markers for your examples, consider using marker classes, like so, and also mentioning why using common classes like Int and String is not a good idea: class IntMarker class StringMarker object M { def m(seq: Seq[Int])(implicit i: IntMarker): Unit = println(s"Seq[Int]: $seq") def m(seq: Seq[String])(implicit i: StringMarker): Unit = println(s"Seq[String]: $seq") } implicit val anIntMarker = new IntMarker implicit val aStringMarker = new StringMarker M.m(List(1,2,3)) M.m(List("one", "two", "three"))

Note from the Author or Editor:
Good idea. I changed the example accordingly.

Robert Yacobellis  Aug 17, 2014 
PDF
Page 153
Last paragraph

First, we won’t hande arrays or nested objects, just “flat” JSON expressions like {"a": "A", "b": 123, "c": 3.14159} May be - First, we won’t HANDLE arrays or nested objects, .....

Note from the Author or Editor:
Fixed.

alex.menshov.1@facebook.com  Aug 20, 2014 
PDF
Page 354
Code example, first method (equalsFields)

def equalFields(other: ProtectedClass1) = (protectedField1 == other.protectedField1) && (protectedField1 == other.protectedField1) && (nested == other.nested) should be def equalFields(other: ProtectedClass1) = (protectedField1 == other.protectedField1) && (protectedField2 == other.protectedField2) && (nested == other.nested)

Dean Wampler
Dean Wampler
O'Reilly Author 
Aug 28, 2014