Hi again,
Am Dienstag, 26. Juli 2011 11:35:08 UTC+2 schrieb Meikel Brandmeyer:
> (defn update!
> [a f & args]
> (let [updated? (promise)
> watch (fn [k a o n] (remove-watch a k) (deliver updated? (not= o
> n)))]
> (add-watch a (Object.) watch)
> (apply swap! a f args)
> @updated?))
>
>
This should probably be:
(defn update!
[a f & args]
(let [result (promise)
watch (fn [k a o n] (remove-watch a k) (deliver result [n (not= o
n)]))]
(add-watch a (Object.) watch)
(apply swap! a f args)
@result))
Anyway...
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en