第一種形式起作用的邏輯原因是什麼,而不是第二種?爲什麼currying不能與函數字面值一起使用?
scala> val d = (a: Int, b: Int) => a + b
d: (Int, Int) => Int = <function2>
scala> val d = (a: Int)(b: Int) => a + b
<console>:1: error: not a legal formal parameter.
Note: Tuples cannot be directly destructured in method or function parameters.
Either create a single parameter accepting the Tuple1,
or consider a pattern matching anonymous function: `{ case (param1, param1) => ... }
val d=(a:Int)(b:Int)=>a+b
'VAL d =(A:強度)=>(B:強度)=>一個+ B' – jwvh