Created
August 21, 2011 16:53
-
-
Save ajkovar/1160841 to your computer and use it in GitHub Desktop.
placeholders
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
def f = println("hi") | |
val f2 = f _ // partially applies it | |
f() // hi | |
f2() // hi | |
val f = () => println("hi") | |
val f2 = f _ // wraps it in a function | |
f() // hi | |
f2()() // hi | |
val x = 4 | |
val x2 = x _ // also gets wrapped in a function | |
println(x) | |
println(x2()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment