apatrida
09/30/2015, 4:47 PMwith
when you want to change the receiver for something. For example:
public fun myAction(functor: OtherClass.(s: String)->Unit): String {
val someOtherClass = OtherClass()
with (someOtherClass) { functor("hello") }
}
that just allowed me to receive an extension function on another object, then change my scope of this
to be that other object, and call the extension. But in this case, you could also just:
someOtherClass.functor("hello")