Chapter 1, page 14:
...by passing a predicate that checks whether the character is true..
should read
...by passing a predicate that checks whether the character is uppercase...
Chapter 1, Page 15:
You can improve the code example
src.getLines().map(x => 1).sum
to
src.getLines().size
Chapter 1, Page 34:
def break = new RuntimeException("break exception")
should be
def break = throw new RuntimeException("break exception")
Chapter 2, Page 44, Listing 2.4:
The suffix list is missing a double quote. It should be
val suffixes = List(
"th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th")
Chapter 2, Page 47:
The word paramaters in the third line of the
doPost
method is misspelled. It should be parameters.
Chapter 2, Page 52:
The
args.findIndexOf(_ == paramName)
method should be replaced with
args.indexWhere(_ == paramName)
Please take a look at the github for complete working example (https://github.com/nraychaudhuri/scalainaction/blob/master/chap02/restclient/src/main/scala/RestClient.scala). The complete example of the Java Servlet service is hosted here (https://github.com/scrawford/TestRestService)
Chapter 2, Page 53:
The
parseArgs
function handles the additional arguments provided to the script, such as request parameters or headers, and returns a Map containing all the name-value pairs.
should read
The
parseArgs
function handles the additional arguments provided to the script, such as request parameters or headers specified in = pairs, and returns a Map containing all the name-value pairs.
Chapter 3, Page 70:
Note that you're invoking the
findOne
or
getCount
method on the underlying collection without using the . operator.
should read
Note that you're invoking the
findOne
or
getCount
method on the underlying collection without using the . (dot) operator.
Chapter 3, Page 79:
NOTE From Scala 2.8 on, case classes without a parameter list are deprecated.
should read
NOTE Since Scala 2.8 on, case classes without a parameter list are deprecated.
-
Chapter 3, Page 81:
But because we have more than one, we have to return a tuple of two elements.
should be
But because we have two, a tuple of two elements is returned. There are multiple ways we can solve the problem. Right now, we have some constraints.
Chapter 6, Page 172:
Java -Xmx512M -jar "%SCRIPT_DIR%sbt-launch.jar" %*
should read
java -Xmx512M -jar "%SCRIPT_DIR%sbt-launch.jar" %*