Created
February 13, 2018 13:38
-
-
Save RobertApikyan/c718105a7c736f83b90b4b0879373d94 to your computer and use it in GitHub Desktop.
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