Hi Meikel, On 25 Jul 2011, at 21:51, Meikel Brandmeyer wrote: > > 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) >
That's cool to know - thanks. So what if I would like #'update to return a boolean representing whether the state has changed rather than call #'changed-fn internally? (which is actually what i'm trying to do, I just refactored the example to be a lot simpler and hopefully clearer). Sam --- http://sma.aaron.name -- 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