Created
May 14, 2010 22:40
-
-
Save aboekhoff/401787 to your computer and use it in GitHub Desktop.
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
;; silly example tail-elimination from cps style to javascript | |
(EV '(let* (f (fn (k x) | |
(k (op* * x x))) | |
g (fn (k _f x) | |
(_f k x)) | |
h (fn (k _f) | |
(k (fn (_k x) | |
(_f _k x)))) | |
(Array (h (fn (k*) (k* (fn (x) x) 42)) f)) | |
h)) | |
var g_0 | |
g_0 = (42 * 42) | |
result = Array(g_0, (function (g_2, g_3) { | |
var g_1; | |
g_1 = g_2((function (g_5, g_6) { | |
var g_4; | |
g_4 = g_3(g_5, g_6); | |
return g_4; | |
})); | |
return g_1; | |
})) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment