(conj {} (map first [{1 2} {3 4} {5 6}]))
{1 2, 3 4, 5 6}
(conj (sorted-set-by #(> %1 %2)) 1 4 2)
#{1 2 4}
((comp (partial apply conj) list) [1 2 3] 4)
[1 2 3 4]
(reduce conj '() '(1 2 3 4 5))
(5 4 3 2 1)
(let [a [0] b (conj a 1)] [a b])
[[0] [0 1]]
(-> (range 10) vec (subvec 0 4) (conj :end))
[0 1 2 3 :end]
(conj {0 9} {0 8} {1 8} {2 8})
{0 8, 1 8, 2 8}
(apply + (conj [0 1 2 3 4] 6))
16
(conj '(2 3) (first '(1 2 3)))
(1 2 3)
(reduce (fn [coll val] (conj coll val)) [] (range 10))
[0 1 2 3 4 5 6 7 8 9]
(reduce #(for [x % y %2] (conj x y)) [[]] [])
[[]]
(reduce ((comp (map inc) (filter even?) (take 5)) conj) [] (range))
[2 4 6 8 10]
(update-in {:foo {:bar [1 2 3]}} [:foo :bar] conj 'hello)
{:foo {:bar [1 2 3 hello]}}
(map #(conj % (first %)) {:a 1, :b 2})
([:a 1 :a] [:b 2 :b])
(doall (concat (conj [1 2 3 4] 42) [99 101]))
(1 2 3 4 42 99 101)
(let [x [:a] y (conj x :b)] (println x y))
nil
"[:a] [:a :b]\n"
(reduce (partial apply conj) [] [[{:A 1} {:B 2}] [{:C 3}]])
[{:A 1} {:B 2} {:C 3}]
(conj (vec (rest [1 2 3])) (first [1 2 3]))
[2 3 1]
(apply conj [{:a 1, :b 2} {:a 2, :b 3}])
{:a 2, :b 3}
(reduce #(update-in % [:foo :bar] conj %2) {} (range 10))
{:foo {:bar (9 8 7 6 5 4 3 2 1 0)}}
(map #(conj (vec %) "|") (partition-all 3 (range 10)))
([0 1 2 "|"] [3 4 5 "|"] [6 7 8 "|"] [9 "|"])
(defn onconnect [thingy x] (swap! thingy update-in [:connections] conj x))
#'user/onconnect
(let [dict {'dup (fn [[x & s] _] (conj s x x)), '* (fn [[x y & s] _] (conj s (* x y)))}] (reductions #((dict %2 conj) %1 %2) () '(5 dup *)))
(() (5) (5 5) (25))
(let [roll (fn [g p] (conj g p)) roll-list (fn [g l] (reduce roll (conj g l)))] (roll-list [] [1 2 3]))
[1 2 3]
(merge-with (fn [r l] (if (set? r) (conj r l) (conj #{} r l))) {:a 1, :b 2} {:a 1, :b 3})
{:a #{1}, :b #{2 3}}
(reduce #(conj %1 (do (prn %2) 99)) [] ["hi" "there"])
[99 99]
"\"hi\"\n\"there\"\n"
(apply conj [1 2 3] 4 [5 6 7 8])
[1 2 3 4 5 6 7 8]
(conj {} ((juxt :key :value) {:key "the key", :value "the value"}))
{"the key" "the value"}
(conj (sorted-map) (rest (sorted-map :a 0 :b 1 :c 3)))
{:b 1, :c 3}
(let [x [1 2 3]] [x (conj x 4) x])
[[1 2 3] [1 2 3 4] [1 2 3]]
(defn subsequences [xs] (reduce (fn [acc v] (if (= (dec v) (last (last acc))) (conj (last acc) v) (conj (last acc) [v]))) [] xs))
#'user/subsequences
(#(reduce (fn [[t f] e] (if (%1 e) [(conj t e) f] [t (conj f e)])) [[] []] %2) odd? [1 2 3 4])
[[1 3] [2 4]]
(let [v []] (for [item [1 2 3]] (conj v item)))
([1] [2] [3])
(map #(conj {:a 1} %) [[:b 2] [:c 3]])
({:a 1, :b 2} {:a 1, :c 3})
(map #(conj nil %) [1 2 3 4 5])
((1) (2) (3) (4) (5))
(reduce #(map conj %1 %2) [[] []] [[:a 1] [:b 2]])
([:a :b] [1 2])
(update-in {:elts [1 2 3]} [:elts] #(conj % 4))
{:elts [1 2 3 4]}
(update-in {:a {:b {:c [1]}}} [:a :b :c] conj 10)
{:a {:b {:c [1 10]}}}
(as-> [1 2] x (conj x 3) (map inc x))
(2 3 4)
(conj (re-seq #"[^ ]+" "this is a test") "hello")
("hello" "this" "is" "a" "test")
(update-in {:items [{:item "program in clojure"}]} [:items] conj {:item "yolo"})
{:items [{:item "program in clojure"} {:item "yolo"}]}
(defn cond-conj [s pred x] (cond-> s pred (conj x)))
#'user/cond-conj
(conj {} {\[ 2, 2 \[} {\[ 5, 5 \[})
{2 \[, 5 \[, \[ 5}
(reductions (fn [acc x] (conj acc x)) [] [1 2 3])
([] [1] [1 2] [1 2 3])
(update {:items [{:item "program in clojure"}]} :items conj {:item "yolo"})
{:items [{:item "program in clojure"} {:item "yolo"}]}
(update-in [1 2 [[3 4 5]]] [2 1] conj 6)
[1 2 [[3 4 5] (6)]]
(reduce conj {} (map vec (partition 2 [:foo "foo" :bar "bar"])))
{:bar "bar", :foo "foo"}
(apply merge-with (partial conj []) [{:hello 1} {:hello 3} {:hello 4}])
{:hello [[1 3] 4]}
(defmacro the-macro [& body] (map #(conj % 'tag) body))
#'user/the-macro
(apply conj [1 2 3 4] [5 6 7 8])
[1 2 3 4 5 6 7 8]