Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Delimited continuations for Clojure
Clojure
tag: v0.1.0

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src/delimc
test/delimc/test
.gitignore
project.clj
readme.textile

readme.textile

delimc

A delimited continuations library for Clojure 1.3.0. Portions based on cl-cont by Slava Akhmechet (http://defmacro.org).

(def cont1 (atom nil))
(def cont2 (atom nil))
(def cont3 (atom nil))

(reset (+ 1 (apply (fn [a b c]
                     (+ (shift k
                          (reset! cont1 k)
                            (k 1))
                         a b c))
                    3 4 (list 5)))) ;; 14

(@cont 2) ;; 15

(reset
  (+ 1 (reset (shift k
                (reset! cont2 k)
                (k 2)))
       (reset (shift k
                (reset! cont3 k)
                (k 3))))) ;; 6

(@cont2 4) ;; 8
(@cont3 10) ;; 15

References

Something went wrong with that request. Please try again.