reset! and merge for (transient {})

2013-07-02 Thread Amir Wasim
Is there reset! and merge a possibility for (transient {}) sometimes we have a doseq and it might be requirement sometime. -- -- 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

reset! and merge for (transient {})

2013-07-02 Thread Amir Wasim
Hi, how we can achieve reset! and merge for (transient {}) e.g. when we have a doseq thanks. -- -- 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

Re: reset! and merge for (transient {})

2013-07-02 Thread Jim
No merge will not work with transients because it uses conj instead of conj! If you absolutely have to do this define your own 'merge!' that uses conj!. I'm not sure what you mean by reset! for transients...reset! is an operation on reference types (atom, ref, agent etc) Jim On 02/07/13

Re: reset! and merge for (transient {})

2013-07-02 Thread dennis zhuang
Maybe he means clear? 2013/7/2 Jim jimpil1...@gmail.com No merge will not work with transients because it uses conj instead of conj! If you absolutely have to do this define your own 'merge!' that uses conj!. I'm not sure what you mean by reset! for transients...reset! is an operation on

Re: reset! and merge for (transient {})

2013-07-02 Thread Jim
what is 'clear' ? cannot find it anywhere... Jim On 02/07/13 12:03, dennis zhuang wrote: Maybe he means clear? 2013/7/2 Jim jimpil1...@gmail.com mailto:jimpil1...@gmail.com No merge will not work with transients because it uses conj instead of conj! If you absolutely have to do

Re: reset! and merge for (transient {})

2013-07-02 Thread dennis zhuang
Clear the collection. user= (doc empty) - clojure.core/empty ([coll]) Returns an empty collection of the same category as coll, or nil nil 2013/7/2 Jim jimpil1...@gmail.com what is 'clear' ? cannot find it anywhere... Jim On 02/07/13 12:03, dennis zhuang wrote:

Re: reset! and merge for (transient {})

2013-07-02 Thread John D. Hume
Note that `merge` is basically just `conj` plus nil-checking, so there's a good chance `conj!` already does what you need. On Jul 2, 2013 5:33 AM, Amir Wasim amir.wa...@gmail.com wrote: Is there reset! and merge a possibility for (transient {}) sometimes we have a doseq and it might be