ClojureDocs

Nav

Namespaces

disj

clojure.core

Available since 1.0 (source)
  • (disj set)
  • (disj set key)
  • (disj set key & ks)
disj[oin]. Returns a new set of the same (hashed/sorted) type, that
does not contain key(s).
2 Examples
user=> (disj #{1 2 3}) ; disjoin nothing 
#{1 2 3} 

user=> (disj #{1 2 3} 2) ; disjoin 2
#{1 3} 

user=> (disj #{1 2 3} 4) ; disjoin non-existent item
#{1 2 3} 

user=> (disj #{1 2 3} 1 3) ; disjoin several items at once
#{2}
user=> (apply disj #{1 2 3} [1 3]) ; disjoin keys in a coll
#{2}
See Also

dissoc[iate]. Returns a new map of the same (hashed/sorted) type, that does not contain a mapping ...

Added by TimMc

disj[oin]. Returns a transient set of the same (hashed/sorted) type, that does not contain key(s).

Added by TimMc

Return a set that is the first set without elements of the remaining sets

Added by ryo

conj[oin]. Returns a new collection with the xs 'added'. (conj nil item) returns (item). (co...

Added by huahaiy
0 Notes
No notes for disj