Created
February 26, 2013 18:37
-
-
Save ryanlecompte/5040910 to your computer and use it in GitHub Desktop.
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
scala> def foo(f: => Unit) { | |
| val saved = f _ | |
| println("saved it, now going to invoke it") | |
| saved() | |
| } | |
foo: (f: => Unit)Unit | |
scala> foo { println("haha!") } | |
saved it, now going to invoke it | |
haha! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment