Skip to content

Instantly share code, notes, and snippets.

@Yuichiroh
Created April 3, 2015 07:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yuichiroh/62589714b12315aaf1c1 to your computer and use it in GitHub Desktop.
Save Yuichiroh/62589714b12315aaf1c1 to your computer and use it in GitHub Desktop.
val n = reset {
println("A")
val num = shift { (cont: Int => Int) =>
println("B")
cont(cont(1))
}
println("num", num)
num * 2
}
println("n", n)
/* Outputs */
// A
// B
// (num,1)
// (num,2)
// (n,4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment