On Sunday, 24 March 2013 22:04:46 UTC+5:30, Richard Elliott wrote: > > Hi, > > If i create an immutable type in java and use an instance of it from > clojure, can I wrap it in an atom and benefit from the concurrency > semantics of swap! etc. >
In this case, making the type immutable is probably encouraged but not mandatory -- at least, the swap! implementation does not use the values in a way that warrants immutability. What is important is the function should be free of side effects because it may be tried several times (during simultaneous updates) to effect the change. Shantanu -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.