Created
May 7, 2010 12:33
-
-
Save kmizu/393363 to your computer and use it in GitHub Desktop.
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
object F { | |
class Link(f: () => Link) extends (() => Link) { | |
def apply(): Link = f() | |
} | |
def f(): Link = { | |
def n(x: Int): Link = { | |
println(x) | |
new Link(() => n(x + 1)) | |
} | |
n(0) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment