John
withIf(myObject.propertyToFiler == true) { myObject -> ... }
molikuner
if (myObject.propertyToFiler == true) with(myObject) { myObject -> ... }
inline fun <T, R : Any> withIf(x: T, access: Boolean, block: (T) -> R) = if (access) with(x, block) else null
streetsofboston
takeIf
takeUnless
A modern programming language that makes developers happier.