柯里化练习

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"

你可能感兴趣的:(柯里化练习)