Created
January 6, 2014 06:03
-
-
Save prassee/8278895 to your computer and use it in GitHub Desktop.
my first CPS code in Scala with some comments in Tamil
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
/** | |
* முதல் தமிழ் நிரல் வர்ணணை | |
* இவற்றுக்கு ஒரு gist உருவக்கப்படும் | |
* இதன் gist முகவரி | |
*/ | |
object CPSIntUnit { | |
var valCon: (Int => Unit) = null | |
def computCont = { | |
shift { | |
k: (Int => Unit) => valCon = k | |
} | |
} | |
reset { | |
println("before shift") | |
0.5 * computCont | |
println("after shift") | |
} | |
println("after reset") | |
println(valCon(3)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment