Why aren't watches adequate? You could test inside them if you really wish
to create the side-effect based on your context.
On Tuesday, April 8, 2014 12:41:50 PM UTC-3, John Hume wrote:
>
> I sometimes find that after mutating an atom, I want to create some
> side-effect that depends on the old
+1 that answer
Also if it served your needs, watches give you the old and new
values
http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/add-watch
On Tuesday, April 8, 2014 11:00:20 AM UTC-5, A. Webb wrote:
>
> See https://groups.google.com/d/topic/clojure/2dHvX7bf7nA/discussion
See https://groups.google.com/d/topic/clojure/2dHvX7bf7nA/discussion,
http://stackoverflow.com/a/22409846/1756702, where the old and new state of
an atom is returned using the lower-level compare-and-set! operation.
On Tuesday, April 8, 2014 10:41:50 AM UTC-5, John Hume wrote:
>
> I sometimes fi
I sometimes find that after mutating an atom, I want to create some
side-effect that depends on the old and new state as well as the context in
which the change was made. Because of the dependence on context, a watch
doesn't work (unless there's something I'm not thinking of). So I add
things to th