Skip to content

Instantly share code, notes, and snippets.

@swannodette
Created March 11, 2009 00:26
Show Gist options
  • Save swannodette/77220 to your computer and use it in GitHub Desktop.
Save swannodette/77220 to your computer and use it in GitHub Desktop.
;; 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