Hi,

you want a watch.

(def a (atom 0))
(add-watch a ::your-id (fn [_your-id _a old-val new-val] (when (not= old-val 
new-val) (println "New value:" new-val))))
(swap! a inc)
(reset! a 1)
(swap! a inc)

Sincerely
Meikel

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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