Created
April 3, 2015 07:13
-
-
Save Yuichiroh/62589714b12315aaf1c1 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
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