distinct?

functionsince v0.0-927 clojure.core/distinct?Edit
(distinct? x)
(distinct? x y)
(distinct? x y & more)

Details:

Returns true if no two of the arguments are =


Examples:

(distinct? 1)
;;=> true

(distinct? 1 2)
;;=> true

(distinct? 1 1)
;;=> false

(distinct? 1 2 3)
;;=> true

(distinct? 1 2 1)
;;=> false

Apply it a collection:

(apply distinct? [1 2 3])
;;=> true

(apply distinct? [1 2 1])
;;=> false

See Also:


Source docstring:
Returns true if no two of the arguments are =
Source code @ clojurescript:src/main/cljs/cljs/core.cljs
(defn ^boolean distinct?
  ([x] true)
  ([x y] (not (= x y)))
  ([x y & more]
     (if (not (= x y))
     (loop [s #{x y} xs more]
       (let [x (first xs)
             etc (next xs)]
         (if xs
           (if (contains? s x)
             false
             (recur (conj s x) etc))
           true)))
     false)))