given:
val m = Map[String, Int](\"a\" -> 1, \"b\" -> 2, \"c\" -> 3) m.foreach((key: String, value: Int) => println(\">>> key=\" + key + \",
oops, read the doco wrong, map.foreach expects a function literal with a tuple argument!
so
m.foreach((e: (String, Int)) => println(e._1 + "=" + e._2))
works