Sets - sorokod/Clojure-Notes GitHub Wiki

#{1 2 3}            ; #{1 3 2} arbitrary order
(sorted-set 1 2 3)  ; #{1 2 3}

Set operations:

(clojure.set/union #{1 2 3} #{0})      ; #{0 1 3 2} 
(clojure.set/union #{1 2 3} #{1})      ; #{1 3 2} 

(clojure.set/difference #{1 2 3} #{2}) ; #{1 3}

Sets also acts as membership functions

(#{1 2 3} 1)  ; 1
(#{1 2 3} 7)  ; nil