柯里化练习
2018-01-03 本文已影响0人
lehuai
CurryingDemo.scala
package day04
//object Context {
// implicit val a = "java"
// implicit val b = "python"
//}
object CurryingDemo {
def m1(str: String)(implicit name: String) = {
str + name
}
def main(args: Array[String]): Unit = {
// val func = m1("Hi--") _
// import Context.a
import Context.b
println(m1("Hi--"))
// println(func)
}
}
Context.scala
package day04
object Context {
implicit val a = "java"
implicit val b = "python"