I can define the function as:
def print(n:Int, s:String = "blah") {} print: (n: Int,s: String)Unit
I can call him:
print(5) print(5, "testing")
If I review above:
def print2(n:Int)(s:String = "blah") {} print2: (n: Int)(s: String)Unit
I can not call it one parameter:
print2(5) <console>:7: error: missing arguments for method print2 in object $iw; follow this method with `_' if you want to treat it as a partially applied function print2(5)
I need to provide both parameters. Is there any way around this?
scala parameters currying
ssanj
source share