, and , , , ,
(2 add "3" and) add "4"
2 add "3" and add "4"
2.add("3").and(add)."4"
DSL. , Scala, Scala, DSL, , .
, "" , and postfix infix, , . then:
object Helper {
implicit class IntHelper(i: Int) {
def add(str: String): Int = i + str.toInt
}
implicit class AndThen[A](in: A) {
def and(t: then.type): A = in
}
object then
}
import Helper._
2 add "3" and then add "4"