Page 359 (PDF page 397):
Following the sequence of code in the book, when I enter:
val immu = Map.empty ++ muta
the response is:
immu: scala.collection.mutable.Map[String,Int] = Map(ii -> 2, i -> 1)
In order to get an immutable Map, I need to make the following changes:
import scala.collection.immutable
val immu = immutable.Map.empty ++ muta
---
Good point. Will add something to clarify need to restart the REPL after
that import of scala.collection.mutable.Map. Tnx.
|