Set
type | removed v0.0-1211 | added v0.0-927 | Edit |
(Set. meta hash-map)
(deftype Set [meta hash-map]
IWithMeta
(-with-meta [coll meta] (Set. meta hash-map))
IMeta
(-meta [coll] meta)
ICollection
(-conj [coll o]
(Set. meta (assoc hash-map o nil)))
IEmptyableCollection
(-empty [coll] (with-meta cljs.core.Set/EMPTY meta))
IEquiv
(-equiv [coll other]
(and
(set? other)
(= (count coll) (count other))
(every? #(contains? coll %)
other)))
IHash
(-hash [coll] (hash-coll coll))
ISeqable
(-seq [coll] (keys hash-map))
ICounted
(-count [coll] (count (seq coll)))
ILookup
(-lookup [coll v]
(-lookup coll v nil))
(-lookup [coll v not-found]
(if (-contains-key? hash-map v)
v
not-found))
ISet
(-disjoin [coll v]
(Set. meta (dissoc hash-map v)))
IFn
(-invoke [coll k]
(-lookup coll k))
(-invoke [coll k not-found]
(-lookup coll k not-found)))