The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

lutzhank (61) [Avatar] Offline
#1
MEAP 11/02/2010

1) Listing 2.4
orig:
val suffixes = List(
"th", "st", "nd", "rd", "th", "th", "th", "th", "th", th")

missing quotation marks before last th => code will not compile:

fix:
val suffixes = List("th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th")

2) After Listing 2.4 first sentence
orig:
"... new implementation of ordinal we’re using range,..."

At this point the reader may not be able to match range and 10 to 20.
Therefore suggestion:
"... new implementation of ordinal we’re using range (10 to 20),..."

3) Before 2.7, third last sentence
orig:
"You can access elements of a List like array using index positions in the List."

This is not clear to me, do you mean
"You can access elements of a List (like suffixes) using index positions."?
otherwise I am confused :-|

4) First listing in 2.7
orig:
"def rangeMatcher(num:Int) = num match..."

rangeMatcher is later referenced as rangeMatcher1
suggestion: change code to
"def rangeMatcher1(num:Int) = num match..."

------------------------------
Corrected MEAP version
Message was edited by: lutzhank
lutzhank (61) [Avatar] Offline
#2
MEAP 11/02/2010

Addition:

5) Paragraph after Listing 2.4, 4th Line
orig: "inclusive range (scala.collection.immutable.Inclusive)."

This is "scala.collection.immutable.Range.Inclusive" in Scala 2.8

scala> 10.to(20)
res1: scala.collection.immutable.Range.Inclusive with scala.collection.immutable.Range.ByOne ... // ByOne is a Trait mixed into Inclusive which inherits from Range.

------------------------------
Corrected MEAP version
Message was edited by: lutzhank