Thanks Ken, I didn't realize I could test it so easily. But I would like it to ideally return the same collection .. Shouldn't be hard to write a wrapper .. But I think it should be the default behaviour. Thanks again, Sunil.
On Tue, Nov 30, 2010 at 7:05 AM, Ken Wesson <kwess...@gmail.com> wrote: > On Mon, Nov 29, 2010 at 8:07 PM, Sunil S Nandihalli > <sunil.nandiha...@gmail.com> wrote: > > Hello everybody, > > I have a small doubt. Suppose > > (def s #{1 2 3 4 5 6}) > > (set s) > > will calling set on an existing set shortcircuit the call and return the > > same set or would it create a new one? I would like to extend the > question > > to hash-map and vec.. > > thanks, > > Sunil. > > Why not just test it for yourself? > > user=> (def s #{1 2 3 4 5 6}) > #'user/s > user=> (= s (set s)) > true > user=> (identical? s (set s)) > false > > Looks like it creates a new object, in the specific case of sets. > > -- > 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<clojure%2bunsubscr...@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 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