Error when calling a method in Scala with a " " rather than a "." -
Error when calling a method in Scala with a " " rather than a "." -
why first pair of method calls (using mkstring
) both work, while sec pair of method calls (using fold
) fail when replace "." " "? parameter type missing?
i'm using scala version 2.11.0.
scala> list("a", "b", "c").mkstring("") res0: string = abc scala> list("a", "b", "c") mkstring("") res1: string = abc scala> list("a", "b", "c").fold(""){(x,y)=> x++y} res2: string = abc scala> list("a", "b", "c") fold(""){(x,y)=> x++y} <console>:8: error: missing parameter type list("a", "b", "c") fold(""){(x,y)=> x++y} ^ <console>:8: error: missing parameter type list("a", "b", "c") fold(""){(x,y)=> x++y}
scala
Comments
Post a Comment