I should note that this also works because of sets being seq-able. Since they're callable, we can use b as the predicate in every?; since they're seq-able we can use a as the coll in every?. Very cool!
On Dec 19, 1:46 pm, Andrew Baine <andrew.ba...@gmail.com> wrote: > Since sets are callable like functions, subset? can be written pretty > concisely: > > user> (defn subset? [a b] (every? b a)) > > It handles the empty set cases correctly and everything. Is this > already in clojure-contrib? Want it and its brethren superset? proper- > subset? proper-superset? in there? > > Andrew --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---