> You can get rid of the I/O in the transaction and still see a consistent > snapshot by simply return the contents of the refs. > > (defn report-status > [] > (apply println (dosync [...@my-hash @new-keys]))) > > Sincerely > Meikel > > --
Isn't ensure necessary? Because http://clojure.org/refs says that - "No changes will have been made by any other transactions to any Refs that have been ref-set/altered/ensured by this transaction." It doesn't guarantee that a ref 'r' will not change if we have (dosync (..bunch of stuff not involving r..) @r (..bunch of stuff not involving r..)). So shouldn't we have to do - (defn report-status [] (apply println (dosync [(ensure my-hash) (ensure new-keys)]))) - Thanx -- 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