(map #(hash-map (first %) (second %)) {:foo 1, :bar 2})
({:foo 1} {:bar 2})
(def foo [[1 [:hello] [:world]] [2 [:foo] [:bar]] [3 [:bad] [:good]]])
#'user/foo
(sort-by :upvotes {:foo {:upvotes 3}, :bar {:upvotes 5}, :baz {:upvotes 2}})
([:foo {:upvotes 3}] [:bar {:upvotes 5}] [:baz {:upvotes 2}])
(let [fs {:foo +, :bar -, :zonk reduce} params {:foo [1 2], :bar [10 5], :zonk [conj #{} [1 2 3]]}] (merge-with apply fs params))
{:bar 5, :foo 3, :zonk #{1 2 3}}
(let [{:keys [foo bar]} [:foo 'a :bar 'b]] (prn foo bar))
nil"nil nil\n"(for [[k v] {:foo "f", :bar "b"}] {:k k, :v v})
({:k :foo, :v "f"} {:k :bar, :v "b"})
(let [L (with-meta '(a b) {:foo :bar})] (meta (next L)))
nil(merge-with clojure.set/union [:foo "foo data" :bar {:bar :data} :bar {:bar :data2}])
[:foo "foo data" :bar {:bar :data} :bar {:bar :data2}]
(let [{:keys [foo bar], :or {:foo 1}} {:bar 5}] [foo bar])
[nil 5]
((fn [{:keys [foo bar]}] (str foo bar)) {:bar "Bar", :foo "Foo"})
"FooBar"(mapcat keys #{{:foo 1, :bar 2} {:baz 3, :quux 4}})
(:baz :quux :foo :bar)
(let [L (with-meta '(a b) {:foo :bar})] (meta (pop L)))
nil(first (filter (comp boolean {:a true, :b :foo}) [:c :b :a]))
:b(->> {:a nil, :b :foo} (filter #(val %)) (reduce merge {}))
{:b :foo}
((comp first ((partial juxt (resolve (symbol (apply str (map char '(105 110 99)))))))) 1)
2(map (juxt list? seq?) ['(a b c) (list 1 2 3) [1 2 3]])
([true true] [true true] [false false])
(->> clojure.core quote the-ns ns-publics seq rand-nth val meta ((juxt :name :doc)) (map println) dorun)
nil"drop-last\nReturn a lazy sequence of all but the last n (default 1) items in coll\n"(let [ops (juxt + - *)] (take 10 (map ops (range) (range 20 10 -2))))
([20 -20 0] [19 -17 18] [18 -14 32] [17 -11 42] [16 -8 48])
((apply juxt (map #(fn [c] (c %)) (range 5))) [:a :b :c :d :e])
[:a :b :c :d :e]
(let [x 1] (meta ^{:foo x} (list 1 x 3)))
nil(map meta (map (fn [x] (with-meta x {:foo 1})) [[2] [3]]))
({:foo 1} {:foo 1})
(let [{:keys [foo jam]} '(:foo 12 :bar 17)] [foo jam])
[12 nil]
(let [[a b] [(repeat 10 :foo) #(println "boom!")]] [a b])
[(:foo :foo :foo :foo :foo :foo :foo :foo :foo :foo) #object [sci.impl.fns$fun$arity_0__26683 0x5ab2aa25 "sci.impl.fns$fun$arity_0__26683@5ab2aa25"]]
((fn [& {:keys [foo]}] foo) 1 2 :foo 3 4 5)
3((fn [& {:keys [foo bar]}] [foo bar]) :foo 1 :bar 2)
[1 2]
((juxt (partial filter identity) (partial keep identity)) [0 1 nil false true 2 nil false])
[(0 1 true 2) (0 1 false true 2 false)]
(let [f (partial * 2)] (mapcat (juxt identity f) [1 2 3 4 5 6]))
(1 2 2 4 3 6 4 8 5 10 6 12)
((apply juxt (map (fn [idx] (fn [v] (get v idx))) [1 2])) [1 3 5])
[3 5]
(let [m ["the" "quick" "brown" "fox"]] ((juxt (partial apply max-key count) (partial min-key count)) m))
["brown" ["the" "quick" "brown" "fox"]]
((comp (partial apply map max) (juxt identity rest)) [1 5 4 3 2 6 7])
(5 5 4 3 6 7)
((comp first (partial apply drop) (juxt second first) vector) [:a :b :c :d :e] 3)
:d(defn zagzig [n] (take n (apply mapcat list ((juxt reverse identity) (range 1 (inc n))))))
#'user/zagzig
(let [L (with-meta '(a b) {:foo :bar})] (meta (conj L 'c)))
{:foo :bar}
(class (assoc-in (sorted-map 1 :foo 2 (sorted-map 10 20)) [2 10] 4))
clojure.lang.PersistentTreeMap(reduce #(assoc %1 %2 %1) nil [:foo :bar :baz :bang :haloooo])
{:bang {:bar {:foo nil}, :baz {:bar {:foo nil}, :foo nil}, :foo nil}, :bar {:foo nil}, :baz {:bar {:foo nil}, :foo nil}, :foo nil, :haloooo {:bang {:bar {:foo nil}, :baz {:bar {:foo nil}, :foo nil}, :foo nil}, :bar {:foo nil}, :baz {:bar {:foo nil}, :foo nil}, :foo nil}}
(into {} (map (fn [pair] [(second pair) (first pair)]) {:foo "foo", :bar "bar"}))
{"bar" :bar, "foo" :foo}
(apply hash-map (apply concat [[:foo 3] [:bar "MRHRAH"] [:baz "Lots of money"]]))
{:bar "MRHRAH", :baz "Lots of money", :foo 3}
((juxt #(seq (.split % " ")) #(seq (.split % " +"))) "a b")
[("a" "" "" "b") ("a" "b")]
((apply juxt (map (partial comp set) [filter remove])) odd? #{1 2 3 4 5})
[#{1 3 5} #{2 4}]
(for [n (range 20)] [n (class (reduce conj (array-map) (map (juxt identity identity) (range n))))])
([0 clojure.lang.PersistentArrayMap] [1 clojure.lang.PersistentArrayMap] [2 clojure.lang.PersistentArrayMap] [3 clojure.lang.PersistentArrayMap] [4 clojure.lang.PersistentArrayMap] [5 clojure.lang.PersistentArrayMap] [6 clojure.lang.PersistentArrayMap] [7 clojure.lang.PersistentArrayMap] [8 clojure.lang.PersistentArrayMap] [9 clojure.lang.PersistentHashMap] [10 clojure.lang.PersistentHashMap] [11 ...
(map #([`#{~%}] (+)) ((juxt filter remove) odd? #{1 2 3 4 5}))
(#{(1 3 5)} #{(4 2)})
(map #([`#{~@%}] (+)) ((juxt filter remove) odd? #{1 2 3 4 5}))
(#{1 3 5} #{2 4})
(map #(zipmap [:name :hp] ((juxt first second) %)) [["foo" 20] ["moo" 30] ["boo" 20]])
({:hp 20, :name "foo"} {:hp 30, :name "moo"} {:hp 20, :name "boo"})
((comp first (partial apply drop) (juxt second first) vector) [:a :b :c :P :e] 3)
:P(->> [1 true false nil] (map (juxt (comp not not) boolean)) (every? (partial apply =)))
true(map (juxt identical? = ==) [3 3000 3000 3000] [3 (+ 1000 2000) 3000 3000.0])
([true true true] [false true true] [false true true] [false false true])
((juxt (comp count filter) (comp count remove)) (comp #{"1.3"} :added) (map meta (vals (ns-publics 'clojure.core))))
[0 538]
(defn zigzag [n] (take n (flatten (apply map vector ((juxt reverse identity) (range 1 (inc n)))))))
#'user/zigzag
(let [append-to-self (comp (partial apply conj) (juxt (fnil identity []) identity))] (map append-to-self [[] [1] [2 3] nil]))
([[]] [1 [1]] [2 3 [2 3]] [nil])
(for [n (range 14 18)] [n (class (reduce conj (array-map) (map (juxt identity identity) (range n))))])
([14 clojure.lang.PersistentHashMap] [15 clojure.lang.PersistentHashMap] [16 clojure.lang.PersistentHashMap] [17 clojure.lang.PersistentHashMap])

