then I guess rather pass "this" ?
# announcements
c
then I guess rather pass "this" ?
m
Please use threads 😉
c
??
ah ok sorry
for 1 instant I thought thread {}
ehehe
m
Hehe 😛
k
Copy code
class Derp {
    fun foo() = bar()
}

fun Derp.bar() = 5
should just work.
c
yes but If I want to give a specific instance as receiver, I need to use "with" I think
k
Derp().bar()
works too.
c
with(receiver){myfunc()}
k
That works too.
d
Just learned this one class MyThis { fun OtherClass.method() = println(this) } fun that( block: MyThis.() -> Unit ) = MyThis().block() that { OtherClass().method() } Calls --> MyThis.method() with this == MyThis