((comp clojure.string/trim (partial apply str)) (conj (range 6) " "))
"012345"
(map class [(cons 3 [1 2]) (conj [1 2] 3)])
(clojure.lang.Cons clojure.lang.PersistentVector)
(defn cconj [coll x] (if x (conj coll x) coll))
#'user/cconj
(:foo (meta (conj (with-meta [1 2 3] {:foo "bar"}) 4)))
"bar"
(conj (re-seq #".*(s).*" "this is a test") "hello")
("hello" ["this is a test" "s"])
(#(apply (partial conj '()) %) [1 2 3 4])
(4 3 2 1)
(conj (sorted-map) {:a 1, :b 2, :c 3, :d 4})
{:a 1, :b 2, :c 3, :d 4}
(reduce (fn [c x] (conj c (inc x))) () (range 10))
(10 9 8 7 6 5 4 3 2 1)
(update-in {:name "arrdem", :plays ["mwo" "scII" "HoTS"]} [:plays] conj "LoL")
{:name "arrdem", :plays ["mwo" "scII" "HoTS" "LoL"]}
(defn pupdate [s f] (conj (pop s) (f (peek s))))
#'user/pupdate
(let [dict {'dup (fn [[x & s] _] (conj s x x)), '* (fn [[x y & s] _] (conj s (* x y)))}] (reduce #((dict %2 conj) %1 %2) () '(5 dup *)))
(25)
(reduce #(if (integer? %2) [(conj (first %1) %2) (second %1)] [(first %1) (conj (second %1) %2)]) [[] []] [1 "a" 2 "b" 3 4])
[[1 2 3 4] ["a" "b"]]
(merge-with (fn [r l] (if (set? r) (conj r l) (conj #{} r l))) {:a 1, :b 2} {:a 1, :b 3, :c 5})
{:a #{1}, :b #{2 3}, :c 5}
(reduce (fn [result entry] (if (even? (count entry)) (conj result entry) (conj (butlast result) (concat (last result) entry)))) [] [[1 2] [3 4] [6 7]])
[[1 2] [3 4] [6 7]]
(-> '{:k1 "stuff", :k2 ["1" "2"]} (update-in [:k2] conj "3"))
{:k1 "stuff", :k2 ["1" "2" "3"]}
(swap! (atom {:a {:b {:c []}}}) update-in [:a :b :c] conj 0)
{:a {:b {:c [0]}}}
(apply conj [] (for [x (range 2) y (range 2)] [x y]))
[[0 0] [0 1] [1 0] [1 1]]
(defn hash-set-from [coll] (reduce #(conj %1 (keyword %2)) (hash-set) coll))
#'user/hash-set-from
(-> (seq [3 4 5]) (with-meta {:my :meta}) (conj 2) meta)
nil
(let [* #(apply * (conj %& 2))] (* 2 2))
8
(mapcat conj (concat (map vector [1 2]) (repeat [])) [3 4 5])
(1 3 2 4 5)
(-> '(3 4 5) (with-meta {:my :meta}) (conj 2) meta)
{:my :meta}
(defn my-map-one [f a-seq] (reduce #(conj % (f %2)) [] a-seq))
#'user/my-map-one
(apply concat (conj '([1 0] [3 2]) '(4 5)))
(4 5 1 0 3 2)
(transduce (comp (map inc) (filter even?) (take 5)) conj [] (range))
[2 4 6 8 10]
(count (reduce conj (hash-map) (for [i (range 30)] [i nil])))
30
(reduce conj '(1 2) [1 2 3 4 5])
(5 4 3 2 1 1 2)
(meta (-> [2 3] (with-meta {:foo :bar}) (conj 8) (empty)))
{:foo :bar}
(take 1 (lazy-seq (conj (lazy-seq (prn :hi) '(2)) 1)))
(1)
":hi\n"
(defmacro unless [test & branches] (conj (reverse branches) test 'if))
#'user/unless
(do (require 'clojure.walk) (clojure.walk/postwalk (partial conj []) [1 2 3 4]))
[[[1] [2] [3] [4]]]
(take 10 (iterate #(conj % (reduce + %)) [1]))
([1] [1 1] [1 1 2] [1 1 2 4] [1 1 2 4 8] [1 1 2 4 8 16] [1 1 2 4 8 16 32] [1 1 2 4 8 16 32 64] [1 1 2 4 8 16 32 64 128] [1 1 2 4 8 16 32 64 128 256])
(defn pop-push [l1 l2] [(rest l1) (conj l2 (first l1))])
#'user/pop-push
(defn my-iterate [f x] (lazy-seq (conj [x] (my-iterate (f x)))))
#'user/my-iterate
(take 5 (map #(conj [1] %) (cycle [2 3])))
([1 2] [1 3] [1 2] [1 3] [1 2])
(seq (reduce #(conj %1 (+ 1 %2)) [] (range 3)))
(1 2 3)
(first ((apply juxt (conj (vec (repeat 500 inc)) println)) 4))
5
"4\n"
(let [a #{1 2} a’ (conj a 3)] a’)
#{1 2 3}
(update-in [[0 1] [2 3] [4 5]] [1] conj :a)
[[0 1] [2 3 :a] [4 5]]
((comp :out reduce) (fn [blob token] (if (= :end token) (update-in (update-in blob [:out] conj (conj (:scratch blob) token)) [:tmp] (constantly [])) (update-in blob [:scratch] conj token))) {:out [], :scratch []} [:start 1 2 3 :end :start 5 6 7 :end])
[[:start 1 2 3 :end] [:start 1 2 3 :start 5 6 7 :end]]
(swap! (atom {:numbers #{0}}) update-in [:numbers] conj 1 2 3)
{:numbers #{0 1 2 3}}
(let [roll (fn [g p] (conj g p))] (roll [2] 3))
[2 3]
(update-in {:a {:b {:c [1 2]}}} [:a :b :c] conj 3)
{:a {:b {:c [1 2 3]}}}
(:foo (meta (conj (with-meta (seq [1 2 3]) {:foo "bar"}) 4)))
nil
(let [chores [1 2 3]] (conj (vec (rest chores)) (first chores)))
[2 3 1]
(reduce #(for [x % y %2] (conj x y)) [[]] [#{}])
()
(reductions #(conj %1 (%2 (last %1))) [1] [inc inc even?])
([1] [1 2] [1 2 3] [1 2 3 false])
(let [a (atom {:foo []})] (swap! a update-in [:foo] conj :x) @a)
{:foo [:x]}
(let [a nil b [1]] (if a (conj b a) b))
[1]
(let [x [1 2] newx (conj x 3)] [x newx])
[[1 2] [1 2 3]]