You can get it here:
http://github.com/swannodette/clj-cont/tree/master

So over the past week I've been porting cl-cont (
http://common-lisp.net/project/cl-cont/) originally written by Slava
Akhmechet to Clojure. I've now ported most of the functionality that's
translatable from Common Lisp though it would be great to hear if something
blatant seems to be missing.  You can now do things like the following:

(let [cc (atom nil)]
   [(with-call-cc
      (letfn [(a [i j] (+ i j))
        (b [i j] (* (a i j) 3))]
(+ (b 1 2) (let-cc k
        (reset! cc k)
         (k 0)))))
    (@cc 1)])

-> [9 10]

Currently these forms are supported:

quote
do
if
let
letfn
apply

cl-cont also defines defn/cc (defn-cc) for creating functions to be used
from within a with-call/cc (with-call-cc) form.  It also has without-call/cc
(without-call-cc) to prevent CPS transformation.  These have also been
ported.

There are 61 tests as of now (all taken from cl-cont's test suite).  Again
this port only supports the shared functionality between Common Lisp and
Clojure, support for Clojure specific forms is mostly missing and this is
what people can help on if they like.  The big questions are which Clojure
special forms should be supported and how (if possible).  Clearly trying to
support lazy sequences isn't a goal, but supporting the STM forms (dosync,
commute) as well the forms that don't rely on side-effects is just a matter
of time.

forks and feedback appreciated.

David

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to