def mainCaller() = {
val name = "xyz"
someList.foreach { u:Map => foo(name, u) }
}
def foo(name:String)(map:Map): Unit = {
//match case....
//recursive call to foo in each case where name remains same, but map changes
}
如何将 foo 编写为部分应用的函数,我不必在每个递归调用中传递名称而只需调用foo(map1)
?