hash-set

function/macrosince v0.0-1443 clojure.core/hash-setEdit
(hash-set)
(hash-set & keys)

Details:

Returns a new hash set with supplied keys.

Any equal keys are handled as if by repeated uses of conj.


See Also:


Source docstring:
Returns a new hash set with supplied keys.  Any equal keys are
handled as if by repeated uses of conj.
Function code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn hash-set
  ([] #{})
  ([& keys] (set keys)))

Macro code @ clojurescript:src/main/clojure/cljs/core.cljc
(core/defmacro hash-set
  ([] `(.-EMPTY cljs.core/PersistentHashSet))
  ([& xs]
    (if (core/and (core/<= (count xs) 8)
                  (every? #(= (:op (cljs.analyzer/unwrap-quote %)) :const)
                    (map #(cljs.analyzer/no-warn (cljs.analyzer/analyze &env %)) xs))
                  (= (count (into #{} xs)) (count xs)))
      `(cljs.core/PersistentHashSet. nil
         (cljs.core/PersistentArrayMap. nil ~(count xs) (array ~@(interleave xs (repeat nil))) nil)
         nil)
      (vary-meta
        `(.createAsIfByAssoc cljs.core/PersistentHashSet (array ~@xs))
        assoc :tag 'cljs.core/PersistentHashSet))))