Hi,
I use cond in dosync but it doesn't work. Here is a function code:
(defn process-request
[offer args]
(logger/log "process called")
(let [offer-value (Double/parseDouble (:offer offer))
out-queue (:out-queue args)
unique-offers (:unique-offers args)
all-offers (:all-offers args)
streams (:streams offer)]
(dosync
(cond
(empty? @unique-offers)
((logger/log "map" @unique-offers)
(alter unique-offers assoc offer-value streams))
:else (logger/log "error")))))
unique-offer is ref for map which is empty so condition (empty?
@unique-offers) is true.
Statement (alter unique-offers assoc offer-value streams) never changes
unique-offers map.
If I remove cond from function it works fine (The function has only dosyn
and alter).
What am I doing wrong?
Thanks
--
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