(last (conj (apply sorted-set [100 1 50]) 20))
100
(= (cons 1 (cons 2 ())) (conj () 2 1))
true
(seq (conj (map identity [1 2 3]) 5))
(5 1 2 3)
(conj (pop [1 2 3 4 5]) 6)
[1 2 3 4 6]
(-> [1 2 3] (concat [4]) (conj 5))
(5 1 2 3 4)
(take 2 (reductions conj [] [1 2 3 4]))
([] [1])
(dotimes [i 100000] (conj [1 2 3] 4))
nil
(merge-with conj {:a nil} {:a 1} {:a 2})
{:a (2 1)}
(defn a-clojure-fn [k mp] (conj [k] (k mp)))
#'user/a-clojure-fn
(map conj {:foo 3, :bar 4} [5 6])
([:foo 3 5] [:bar 4 6])
(defn roll [queue] (conj (pop queue) (peek queue)))
#'user/roll
((partial reduce conj '()) #{1 2 3})
(2 3 1)
(apply conj (reduce (fn [[results chunk] item] (if (= item (peek chunk) :c) [(conj results (pop chunk)) []] [results (conj chunk item)])) [[] []] [:a :b :c :c :d :e :c :c :f]))
[[:a :b] [:d :e] [:f]]
(reduce (fn [acc [x y]] (-> acc (update-in [0] conj x) (update-in [1] conj y))) [[] []] (partition 2 (range 10)))
[[0 2 4 6 8] [1 3 5 7 9]]
(reduce (fn [[o e] v] (if (even? v) [o (conj e v)] [(conj o v) e])) [[] []] (range 10))
[[1 3 5 7 9] [0 2 4 6 8]]
(reduce (fn [a b] [(conj (first a) (first b)) (conj (second a) (second b))]) [[] []] [["a" "1"] ["b" "2"]])
[["a" "b"] ["1" "2"]]
(defn foo [x] (let [add-5? (fn [y] (if (> x 8) (conj y 5) y))] (-> [3] (conj 4) add-5?)))
#'user/foo
(reduce conj [:a :b :c] (repeat 10 0))
[:a :b :c 0 0 0 0 0 0 0 0 0 0]
(conj nil {:a 1} {:b 1} {:c 1})
({:c 1} {:b 1} {:a 1})
(conj #{[1 2] [10 20]} [100 200])
#{[1 2] [10 20] [100 200]}
(reduce ((map inc) conj) #{} [0 1 2])
#{1 2 3}
(apply conj '{1 2} '({3 4}))
{1 2, 3 4}
(swap! (atom {}) update-in [:a] (fnil conj #{}) :a)
{:a #{:a}}
(reduce conj '() '(1 2 3 4))
(4 3 2 1)
(defn into [to from] (reduce conj to from))
#'user/into
(swap! (atom {}) update-in [:deletes] conj 13 12 1)
{:deletes (1 12 13)}
(nth (conj '(1 2 3) 4) 0)
4
(conj (subvec (vec (range 10)) 0 5) :end)
[0 1 2 3 4 :end]
(into [] (conj (seq (vector 1 2 3)) 4))
[4 1 2 3]
(reduce conj [:a :b] [1 2 3 4])
[:a :b 1 2 3 4]
(apply conj {} [[1 2] [3 4] [5 6]])
{1 2, 3 4, 5 6}
(defn rotate-queue [queue] (conj (pop queue) (peek queue)))
#'user/rotate-queue
(update-in {:elts [1 2 3]} [:elts] conj 4)
{:elts [1 2 3 4]}
(swap! (atom {}) update-in [:deletes] (fnil conj []) 13 12 1)
{:deletes [13 12 1]}
(let [a (atom '(1))] (swap! a conj 0))
(0 1)
(-> [1 2 3 4 5] pop (conj 42))
[1 2 3 4 42]
(take 3 (iterate #(conj % "hi") (list "hi")))
(("hi") ("hi" "hi") ("hi" "hi" "hi"))
(conj {:a 1, :b 2} {:c 3, :d 4})
{:a 1, :b 2, :c 3, :d 4}
(reduce conj {} '([:a 1] [:b 2] [:c 3]))
{:a 1, :b 2, :c 3}
(conj {:a 1} (vec (seq {:b 2, :a 3})))
{:a 1, [:b 2] [:a 3]}
(class (apply conj {} (map vector (range 200) (range 200))))
clojure.lang.PersistentHashMap
(defprotocol Stack (conj [coll value]) (peek [coll]) (pop [coll]))
{:ns #object[sci.impl.vars.SciNamespace 0x37a47b18 "user"], :name user/Stack, :methods #{#object[clojure.lang.MultiFn 0x6312de9 "clojure.lang.MultiFn@6312de9"] #object[clojure.lang.MultiFn 0x20eb970 "clojure.lang.MultiFn@20eb970"] #object[clojure.lang.MultiFn 0xcc94699 "clojure.lang.MultiFn@cc94699"]}, :sigs {:conj {:name conj, :arglists ([coll value]), :doc nil}, :peek {:name peek, :arglists ([co...
(vec (for [i (range 3)] (reduce conj [] (range 5))))
[[0 1 2 3 4] [0 1 2 3 4] [0 1 2 3 4]]
(-> [] (conj "foo" "bar") (->> (interpose "/") (apply str)))
"foo/bar"
(merge-with conj {:a [1], :b [2]} {:a [3]})
{:a [1 [3]], :b [2]}
(#(reduce conj () %) [:a :b :c 42 :d])
(:d 42 :c :b :a)
(->> "bar" (conj []) (into ["foo"]) (interpose "/") (apply str))
"foo/bar"
(let [coll (vector 1 2 3 4) seq-version (seq coll)] {:coll (conj coll 5), :seq (conj seq-version 5)})
{:coll [1 2 3 4 5], :seq (5 1 2 3 4)}
(type (reduce conj {:a 0} (repeat 100 [1 2])))
clojure.lang.PersistentArrayMap
(conj {:a :b, :d :q} {:a :c, :b :d})
{:a :c, :b :d, :d :q}