store/[org.clojure/clojure "1.6.0"] clj::clojure.core/set

Official Documentation

Add notes
Arities
==================================================
   [coll]

Docstring
==================================================
  Returns a set of the distinct elements of coll.

Source

(defn set
  "Returns a set of the distinct elements of coll."
  {:added "1.0"
   :static true}
  [coll] (clojure.lang.PersistentHashSet/create (seq coll)))

Example 1

Edit
(set [1 2 3 2 1 2 3])
;; => #{1 2 3}

#{:a :b :c :d}
;; => #{:d :a :b :c}

(hash-set :a :b :c :d)
;; => #{:d :a :b :c}

(sorted-set :a :b :c :d)
;; => #{:a :b :c :d}

(def s #{:a :b :c :d})
;; =>  #'user/s

(conj s :e)
;; => #{:d :a :b :e :c}

(count s)
;; => 4

(seq s)
;; => (:d :a :b :c)

(= (conj s :e) #{:a :b :c :d :e})
;; => true

(s :b)
;; => :b

(s :k)
;; => nil

Example 2

Edit
;; returns distinct elements
(set '(1 1 2 3 2 4 5 5))
;; => #{1 2 3 4 5}

;; returns distinct elements (different nomenclature)
(set [1 1 2 3 2 4 5 5])
;; => #{1 2 3 4 5}

(set [1 2 3 4 5])  
;; => #{1 2 3 4 5}

(set "abcd")
;; => #{\a \b \c \d}

(set '("a" "b" "c" "d"))
;; => #{"a" "b" "c" "d"}

(set {:one 1 :two 2 :three 3})
;; => #{[:two 2] [:three 3] [:one 1]}

Uses on crossclj