> Well, except that count and empty are broken for some reason: > > user=> (.count (Bag. {} 0)) > 0 > user=> (count (Bag. {} 0)) > 1 > > I don't understand what's causing this, but empty bags are always > returning a count of 1 (and false from empty?) although the .count > method correctly returns zero. I've traced the problem as far as the > Java method clojure.lang.RT/count but no farther at this time.
Argh. This same bug causes union to blow up in the case of (union (bag 1) (bag)). It works with (union #{1} #{}), by contrast. It traces back to empty? wrongly returning true, and thus to count wrongly returning 1 even though .count correctly returns 0. -- 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