On 09.06.2009, at 07:31, Richard Newman wrote: > Has there been any thinking about supporting a 'bag' sibling of 'set', > and allowing it to be passed correctly through the relational > operators? Right now I have a choice between rephrasing my code in > non- > relational terms, or adding a unique value to each item to thwart the > distinctness semantics. I can't help but think that other people will > also encounter this.
There's an outline of an implementation of multisets (I think that's the same as your bags) at: http://code.google.com/p/clojure-contrib/source/browse/trunk/src/ clojure/contrib/types/examples.clj A full implementation could be built using the same methods and tools, and you'd have set operations that work equally with sets and multisets, even permitting mixing the two. The price to pay is the execution time overhead of multimethod dispatch. Konrad. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---