Created
March 11, 2009 00:26
-
-
Save swannodette/77220 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
;; holy crap! continuations should very much be possible! | |
(defn make-list3 [n k] | |
(if (zero? n) | |
(trampoline k '()) | |
(fn [] (make-list3 (dec n) (fn [l] #(k (conj n l))))))) | |
;; works! | |
(time (trampoline make-list3 1000000 (fn [l] l))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment