Hi All,
I have a ref with a watcher on it, and I call another function from
the
watch function. I can see that call happens, but the for construct
doesn't
seem to run. Any idea why this is? Am I doing something wrong?
Here is a simplified version of the code:
(def numbers (ref #{1 2 3 4 5 6 7 8 9}))
(defn more-actions
[col]
(println "this prints" )
(for [x (range 10)] (println "this doesn't print" col x)))
(defn watcher
[akey aref old-val new-val]
(println "new value:" new-val)
(more-actions new-val)
)
(add-watch numbers "foo" watcher)
(dosync (alter numbers disj 1))
Thanks in advance,
Thomas
ps. I am running 1.2.1
--
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