scala> def sum(a:Int)(b:Int) = a+b;
sum: (a: Int)(b: Int)Int
scala> var psum = sum(5)_
psum: Int => Int = $$Lambda$1035/[email protected]
scala> psum(23)
res0: Int = 28
위의 조각은 잘하지만 확실하지 작동스칼라 세 가지 인수 기능을 무두질
scala> def sum(a:Int)(b:Int)(c:Int) = a + b + c;
sum: (a: Int)(b: Int)(c: Int)Int
scala> var psum = sum(5)_(23)
def sum (a : Int) (b : Int) (c : Int) = s "a : $ a, b : $ b, c : $ c "; val psum = (합계 (5) _) (23); psum (50) == "a : 5, b : 23, c : 50"''' – pedrofurla
또한 "+"가 교환 적이기 때문에 동일한 대답 만 제공한다는 사실을 알고 있습니까? 그것은 주문이나 기능 적용과 관련이 거의 없습니다. – pedrofurla
넵, 지금 내가보기에 잘못 본 것 같습니다. 그것을 고쳐, 고마워! –