(reduce conj {} (map vec (partition 2 [:foo "foo" :bar "bar"])))
{:bar "bar", :foo "foo"}
(meta (persistent! (transient (with-meta {:a 0, :b 1} {:foo :bar}))))
nil(first (vec (concat [1 2 3] [(print :foo) 5 6])))
1":foo"(#(vector :foo (apply str %&)) [:a 1 :b 2])
[:foo "[:a 1 :b 2]"]
(let [L (with-meta '(a b) {:foo :bar})] (pop L))
(b)
(loop [x {:foo {:bar []}} y 0] (let [y (inc y)] (if (< y 10) (recur (update-in x [:foo :bar] conj y) y) x)))
{:foo {:bar [1 2 3 4 5 6 7 8 9]}}
(sort-by (juxt :a :b) [{} {:a 0, :b 1} {:b 3} {:a 12, :b 1}])
({} {:b 3} {:a 0, :b 1} {:a 12, :b 1})
((juxt (comp set filter) (comp set remove)) odd? #{1 2 3 4 5})
[#{1 3 5} #{2 4}]
(map (juxt :step :acc) [{:step 2, :acc :sharp, :d "foo"} {:step 3, :d "foo"}])
([2 :sharp] [3 nil])
(defn or-comp [args & fns] (let [f (apply juxt fns)] (some true? (f args))))
#'user/or-comp
((apply juxt [:a :b :c :d]) {:a 1, :b 2, :c 3, :d 4})
[1 2 3 4]
(sort-by (juxt second first) [[1 2] [2 1] [3 3] [2 3] [3 2]])
([2 1] [1 2] [3 2] [2 3] [3 3])
(map (juxt first count) (partition-by identity [:a :a :a :b :b :c :d :d]))
([:a 3] [:b 2] [:c 1] [:d 2])
(let [v [:a :b]] (map (apply juxt v) [{:a 1, :b 2, :c 3}]))
([1 2])
(letfn [(decorate [& fs] (apply juxt identity fs))] (map (decorate inc -) (range 5)))
([0 1 0] [1 2 -1] [2 3 -2] [3 4 -3] [4 5 -4])
(defn or-fns [& fns] (fn [& args] (some true? (apply (apply juxt fns) args))))
#'user/or-fns
(reduce-kv (fn [m k v] (if (m k) (update-in m [k] v) m)) {:foo 1, :bar "2"} {:foo str, :bar #(Integer/parseInt %)})
{:bar 2, :foo "1"}
(map (comp (partial into {}) seq) [{:a 0, :b 1} {:Foo :bar}])
({:a 0, :b 1} {:Foo :bar})
(class (assoc-in (sorted-map 1 :foo 2 (sorted-map 10 20)) [1] 4))
clojure.lang.PersistentTreeMap(map #(vector (first %) (second %)) {:foo 1, :bar 2})
([:foo 1] [:bar 2])
(let [m {:foo "bar", :baz "qux"}] (zipmap (vals m) (keys m)))
{"bar" :foo, "qux" :baz}
(let [s #{:foo :bar} i (first s)] (disj s i))
#{:foo}
(apply hash-map [:foo "foo data" :bar {:bar :data} :bar {:bar :data2}])
{:bar {:bar :data2}, :foo "foo data"}
(into {} (map (juxt :id identity) '({:id 1, :data 123} {:id 2, :data 456})))
{1 {:data 123, :id 1}, 2 {:data 456, :id 2}}
(#(into {} (map (juxt key (comp %1 val)) %2)) inc {1 2, 3 4})
{1 3, 3 5}
(let [i 3] ((juxt #(subs % 0 i) #(subs % i)) "abcdefg"))
["abc" "defg"]
(map (juxt (partial + 1) (partial + 2) (partial + 3)) [1 2 3])
([2 3 4] [3 4 5] [4 5 6])
(sort-by (juxt first second) [[1 2] [2 1] [3 3] [2 3] [3 2]])
([1 2] [2 1] [2 3] [3 2] [3 3])
((fn [paths] (reduce (fn [m [path value]] (assoc-in m `(~@path ::self) value)) {} paths)) '([(:foo :bar :baz) 1] [(:foo :bar :baz :quux) 2]))
{:foo {:bar {:baz {:quux {:user/self 2}, :user/self 1}}}}
(map meta (map (fn [x] #{:foo 1} x) [[2] [3]]))
(nil nil)
(let [[a b] (repeat 10 :foo) #(println "boom!")] [a b])
[:foo :foo]
(merge-with (fn [r l] r) {:foo "Lucy"} {:bar "Ethel"} {:bar "Ricky"})
{:bar "Ethel", :foo "Lucy"}
(apply (fn [& {:keys [foo]}] (inc foo)) (apply concat {:foo 1}))
2(map key (sort-by val > {:foo 5, :bar 2, :baz 10}))
(:baz :foo :bar)
(reduce (fn [m k] (assoc m k 42)) {} [:foo :bar :baz])
{:bar 42, :baz 42, :foo 42}
(let [key :foo] ((fn [& {:keys [foo]}] (prn foo)) key 1))
nil"1\n"(let [[& {:keys [foo bar]}] [:foo 'a :bar 'b]] [foo bar])
[a b]
(let [m ["the" "quick" "brown" "fox"]] (apply (juxt (partial max-key count) (partial min-key count)) m))
["brown" "fox"]
(map (juxt class pr-str) [(list 1 2 3) (map inc [0 1 2]) (cons 1 ())])
([clojure.lang.PersistentList "(1 2 3)"] [clojure.lang.LazySeq "(1 2 3)"] [clojure.lang.Cons "(1)"])
(filter #(if-let [x (% {:yes 1})] ((juxt identity %) {:yes 1})) [:no :yes :bad])
(:yes)
((juxt #(do %& %1) (fn [& args] (nth args 1))) 1 2 3)
[1 2]
(let [q '(1 2 3)] ((juxt vec counted?) (concat q [4 5 6])))
[[1 2 3 4 5 6] false]
((juxt #(+ % 8) #(* % 3) #(mod % 2)) 12)
[20 36 0]
((fn coerced-select [m keys] (into {} (map (juxt identity m) keys))) {:a 0} [:a :b])
{:a 0, :b nil}
(defn and-fns [& fns] (fn [& args] (every? true? (apply (apply juxt fns) args))))
#'user/and-fns
(map (juxt println identity) [1 2 3 4 5 6 7 8 9 10])
([nil 1] [nil 2] [nil 3] [nil 4] [nil 5] [nil 6] [nil 7] [nil 8] [nil 9] [nil 10])
"1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n"(let [L (with-meta '(a b) {:foo :bar})] (type (pop L)))
clojure.lang.PersistentList(def x (with-meta [1 2 3 4] {:type :foo, :bar :baz}))
#'user/x
(first (filter (comp true? {:a true, :b :foo}) [:b :c :a]))
:a(let [x 1] (meta (with-meta (list 1 x 3) {:foo x})))
{:foo 1}

