Skip to content

Instantly share code, notes, and snippets.

@s1monw1
Created Sep 16, 2022
Embed
What would you like to do?
// return receiver T
fun T.also(block: (T) -> Unit): T //T exposed as it
fun T.apply(block: T.() -> Unit): T //T exposed as this
// return arbitrary value R
fun <T, R> T.let(block: (T) -> R): R //T exposed as it
fun <T, R> T.run(block: T.() -> R): R //T exposed as this
// return arbitrary value R, not an extension function
fun <T, R> with(receiver: T, block: T.() -> R): R //T exposed as this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment