In my Scala code below, use foreach to loop through a Tuple List,
val t1 = List((1,"A"), (2, "B"))
t1.foreach{
case(id, name) => println(id, name)
}
t1.foreach(x => println(x))
t1.foreach(case(id, name) => println(id, name))
error: illegal start of simple expression
t1.foreach(case(id, name) => println(id, name))
^
Why {} works, first () works, but last () return an error ?