Hullaballoonatic
04/17/2019, 7:58 PMlist.any it.hasFoo
Cody Engel
04/17/2019, 7:59 PMinfix
already allow for that?Hullaballoonatic
04/17/2019, 8:01 PMbdawg.io
04/17/2019, 9:47 PMinfix fun A.apply(configure: A.() -> Unit): A {
configure()
return this
}
A() apply { doSomething() }
vs fun A.apply(configure: A.() -> Unit): A {
configure()
return this
}
A().apply { doSomething() }
if
statements in that they should be avoided and have brackets unless it’s used as an expression ie, val a = if (b) "was true" else "was false"
it.hasFoo
is a bit ambiguous though and would probably be better expressed as list.any(T::hasFoo)
instead of adopting a no-bracket lambda expression