Skip to content

Instantly share code, notes, and snippets.

@sliskiCode
Created December 5, 2017 20:16
Show Gist options
  • Save sliskiCode/09ac13a127c2de68469c8fd81618d1ee to your computer and use it in GitHub Desktop.
Save sliskiCode/09ac13a127c2de68469c8fd81618d1ee to your computer and use it in GitHub Desktop.
6 magic sugars that can make your Kotlin codebase happier #12
val receiver: String = "Fructos"
val block: String.() -> Unit = {
println(toUpperCase())
println(toLowerCase())
println(capitalize())
}
val result: Unit = with<String, Unit>(receiver, block)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment