On Feb 4, 5:39 am, Rich Hickey <richhic...@gmail.com> wrote: > On Feb 3, 11:16 pm, "Stephen C. Gilardi" <squee...@mac.com> wrote: > > > On Feb 3, 2009, at 10:44 PM, Jason Wolfe wrote: > > > > user> (contains? (.keySet {:a :b}) :a) > > > false > > > > It seems that all that's required to make "contains?" work on general > > > Sets is to replace "IPersistentSet" with "Set" on lines 648 and 649 of > > > RT.java. I can make a patch if desired. > > > Along those lines, would it be a good idea for the object returned by > > clojure.core/keys to implement java.util.Set and/or > > clojure.lang.IPersistentSet? > > Right now keys is just a filter on the seq of the map. I wouldn't be > opposed to it being an IPersistentSet, but keys must be a constant- > time operation, so the set would have to be a view on the map, not a > copy of the keys.
OK, I put up an issue & patch here: http://code.google.com/p/clojure/issues/detail?id=66&colspec=ID%20Type%20Status%20Priority%20Reporter%20Owner%20Summary Comments/questions/criticisms welcome. -Jason --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---