Skip to content

Instantly share code, notes, and snippets.

@jnhnum1
Forked from lihaoyi/gist:5430318
Last active December 16, 2015 11:49
Show Gist options
  • Save jnhnum1/5430319 to your computer and use it in GitHub Desktop.
Save jnhnum1/5430319 to your computer and use it in GitHub Desktop.
var x = 0
println("reset{} " +
reset{
x = shift{ cont: (Int => Int) =>
println("cont(1): " + cont(1))
println("cont(2): " + cont(2))
5
}
println("reset() " + x)
x * 2
}
)
(pp
(call/cc
(lambda (cont)
(pp (cont 1))
(pp (cont 2))
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment