STM in Clojure (Beispiele)

Clojure = LISP für JVM

(def foo (ref "bar"))  -- newTVar

(deref foo)            -- readTVar
@foo

(ref-set foo "oof")    -- writeTVar
(dosync (ref-set foo "oof"))
Quellen:



Johannes Waldmann 2011-06-29