1.3.0 permalink Arrow_down_16x16

superset?

clojure.set

  • (superset? set1 set2)
Is set1 a superset of set2?

1 Example top

  • (use '[clojure.set :only [superset?]])
    
    user=> (superset? #{0} #{0})
    true
    
    user=> (superset? #{0 1} #{0})
    true
    
    user=> (superset? #{0} #{0 1}) 
    false
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/set.clj:150 top

(defn superset? 
  "Is set1 a superset of set2?"
  {:added "1.2",
   :tag Boolean}
  [set1 set2]
  (and (>= (count set1) (count set2))
       (every? #(contains? set1 %) set2)))
Vars in clojure.set/superset?:
Used in 0 other vars

Comments top

No comments for superset?. Log in to add a comment.