Skip to content

Instantly share code, notes, and snippets.

@ajkovar
Created August 21, 2011 16:53
Show Gist options
  • Save ajkovar/1160841 to your computer and use it in GitHub Desktop.
Save ajkovar/1160841 to your computer and use it in GitHub Desktop.
placeholders
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