hash-set

added
1.0

ns
clojure.core

type
function

(hash-set) (hash-set & keys)

Returns a new hash set with supplied keys.  Any equal keys are
handled as if by repeated uses of conj.

                ;; Any duplicates are squashed (no error)
(hash-set 1 2 1 3 1 4 1 5)
;;=> #{1 4 3 2 5}

;; There is an equivalent reader macro '#{...}'
(= (hash-set :c :a :b) #{:b :a :c})
;;=> true 

;; A string can be treated as a sequence to produce
;; a set of the characters found in the string.
(apply hash-set (seq "Lorem ipsum dolor sit amet"))
;;=> #{\\space \\a \\d \\e \\i \\L \\l \\m \\o \\p \\r \\s \\t \\u}