This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
infix fun <T> Boolean.then(param:T):T? = if(this) param else null | |
infix fun <T> T.ifNot(param: T):T? = if (this.isNull()) param else this | |
{ | |
val isFirst = false | |
Log.d("loog","${isFirst then "First" ifNot "Second"}") | |
} | |
// output "Second" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment