Rick
12/03/2019, 11:23 AMKroppeb
12/03/2019, 11:30 AMdiff({//do some},{// do some})
or diff({//do some}){// do some}
Rick
12/03/2019, 11:31 AMKroppeb
12/03/2019, 11:34 AMBurkhard
12/03/2019, 11:42 AMfoo {}{}
is actually possible, although it comes with some performance overhead and I would advice against it. The trick is that foo returns a function taking another lambda as it’s argument.
https://pl.kotl.in/NFoCKXcuPKroppeb
12/03/2019, 11:43 AM(foo{}){}
and foo{}(){}
to work but not foo{}{}
Burkhard
12/03/2019, 11:44 AM(foo{}){}
to foo{}{}
. I would say too bad, but than I didn’t think it good style anyways.E.Kisaragi
12/03/2019, 11:55 AMKroppeb
12/03/2019, 12:00 PME.Kisaragi
12/03/2019, 12:01 PMJordan Stewart
12/05/2019, 5:53 PMinfix fun <T> (() -> T).diff(other: () -> T) {}
fun doIt() {
{ "this" } diff { "that" }
}