Last active
March 15, 2019 18:50
-
-
Save renaudcerrato/904bd296cb15af0e0e97c0dec4da56f3 to your computer and use it in GitHub Desktop.
Kotlin Infix Functions (Standard Library)
This file contains hidden or 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
// until and step are infix functions | |
for(i in 0 until 100 step 2) println("$i") | |
// equivalent to: | |
for(i in 0.until(100).step(2)) println("$i") | |
// downTo is an infix function | |
for(i in 100 downTo 0) println("$i") | |
// shl, and, xor are infix functions | |
val i = (0x65acf9 shl 6) and 0x55 xor 0x80 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment