我发现在Scala中使用分部函数作为参数时,不需要使用括号 val array = Array(2)
array.map { case x => x +1 } { case x => x + 1 }在这里定义了一个分部函数,所以它应该是array.map({ case x => x + 1 }),但是没有pare
为什么Scala 2.11.0-M3编译器在使用圆括号()时会给出error: identifier expected but integer literal found.,而使用花括号{}则可以很好地进行编译Welcome to Scala version 2.11.0-M3 (Java HotSpot(TM) 64-Bit Server VM, Javascala> val s = &qu