object test10 {
def main(args: Array[String]): Unit = {
def fun(i: Int): String => (Char => Boolean) = {
def f1(s: String): Char => Boolean = {
def f2(c: Char): Boolean = {
if (i == 0 && s == "" && c == '0') true else false
}
f2
}
f1
}
println(fun(0)("")('0'))
//匿名函数简写
def fun2(i: Int): String => (Char => Boolean) = {
s => c => if (i == 0 && s == "" && c == '0') true else false
}
println(fun2(0)("")('0'))
//柯里化
def fun3(i:Int)(s:String)(c:Char):Boolean={
if (i == 0 && s == "" && c == '0') true else false
}
}
}