((juxt keep filter) identity [1 nil 2 false 3])
[(1 2 false 3) (1 2 3)]
(first (filter (juxt identity println) [0 1 2 3]))
0"0\n1\n2\n3\n"((juxt (fn [a] a) (fn [& a] a)) :a)
[:a (:a)]
(apply zipmap ((juxt vals keys) {:a 34, :b 3241}))
{34 :a, 3241 :b}
((juxt #(apply min %) identity) [1 2 3])
[1 [1 2 3]]
((juxt filter remove) (partial < 5) (shuffle (range 10)))
[(8 6 9 7) (3 2 4 0 5 1)]
(apply zipmap ((juxt vals keys) {0 :a, 1 :b}))
{:a 0, :b 1}
((juxt concat into) [1 2 3 4] [5 6])
[(1 2 3 4 5 6) [1 2 3 4 5 6]]
(map (juxt + - * /) (range 1 3))
([1 -1 1 1] [2 -2 2 1/2])
(update-in {:foo {:bar [1 2 3 4 5 6]}} [:foo :bar] #(remove even? %))
{:foo {:bar (1 3 5)}}
(update-in {:foo {:bar {:baz [1 2 3 4]}}} [:foo :bar :baz] #(map inc %))
{:foo {:bar {:baz (2 3 4 5)}}}
(as-> {:foo 12} {:keys [foo bar], :as m} (assoc m :foo 13) (assoc m :bar foo))
{:bar 13, :foo 13}
(into {} (filter (comp (complement #{:foo :baz}) key) {:foo 3, :bar 4, :baz 5, :bing 6}))
{:bar 4, :bing 6}
(let [coll [{:i1 1, :i2 2} {:i1 3, :i2 4}]] (into {} (map (juxt identity (apply juxt coll)) (keys (first coll)))))
{:i1 [1 3], :i2 [2 4]}
(let [maps [{:a 1, :b 2} {:a 2, :b 2}]] (into {} (map (juxt identity (apply juxt maps)) (keys (first maps)))))
{:a [1 2], :b [2 2]}
(merge-with #(%1 %2) {:foo identity, :bar #(* 2 %)} {:foo 1, :bar 3})
{:bar 6, :foo 1}
(apply (juxt min max) (repeatedly 1000 (fn [] (rand 1))))
[4.5157807567408614E-4 0.9991579719719332]
((juxt :two :one) {:one 1, :three 3, :two 2})
[2 1]
((juxt keys vals) {:a 2, :b 3, :c 4})
[(:a :b :c) (2 3 4)]
(into {} (map (juxt val key) {:a 1, :b 2}))
{1 :a, 2 :b}
(map print ((juxt identity pr-str) {:a "hello", :b 'hello}))
(nil nil)
"{:a hello, :b hello}{:a \"hello\", :b hello}"(filter (juxt println identity) (apply list [1 2 3]))
(1 2 3)
"1\n2\n3\n"(apply concat (mapv (juxt dec identity inc) (range 10)))
(-1 0 1 0 1 2 1 2 3 2 3 4 3 4 5 4 5 6 5 6 7 6 7 8 7 8 9 8 9 10)
((juxt :a :b) {:a 1, :b 2, :c 3})
[1 2]
((juxt :x :y) {:x 0, :y 1, :z 2})
[0 1]
(nth (iterate (juxt first second) '[first second]) 1000)
[first second]
(map (juxt (comp count val) key) (group-by odd? [1 2 7 9 8 5 1 0 1]))
([6 true] [3 false])
((juxt type identity) (apply list `(a b c)))
[clojure.lang.PersistentList (user/a user/b user/c)]
(def square (comp (partial apply *) (juxt identity identity)))
#'user/square
((juxt :a :c) {:a 1, :b 2, :c 3})
[1 3]
((juxt keys vals) {:a 1, :b 2, :c 3})
[(:a :b :c) (1 2 3)]
(into {} (map (juxt keyword identity)) {"a" "b", "c" "d"})
{nil ["c" "d"]}
(defn map-vals [f] (map (juxt key (comp f val))))
#'user/map-vals
((juxt identity #(assoc % :a "1")) {:b "2"})
[{:b "2"} {:a "1", :b "2"}]
(map (juxt identity char) (range (int \a) (int \z)))
([97 \a] [98 \b] [99 \c] [100 \d] [101 \e] [102 \f] [103 \g] [104 \h] [105 \i] [106 \j] [107 \k] [108 \l] [109 \m] [110 \n] [111 \o] [112 \p] [113 \q] [114 \r] [115 \s] [116 \t] [117 \u] [118 \v] [119 \w] [120 \x] [121 \y])
(map print ((juxt str pr-str) {:a "hello", :b 'hello}))
(nil nil)
"{:a \"hello\", :b hello}{:a \"hello\", :b hello}"(map (juxt sequential? map? list? vector? seq?) [() [] #{} {} (lazy-seq)])
([true false true false true] [true false false true false] [false false false false false] [false true false false false] [true false false false true])
(cond (= 1 0) :foo :else :bar)
:bar(defn make-foo [x] {:op :foo, :x x})
#'user/make-foo
(-> [] (with-meta {:foo 1}) (conj :x) meta)
{:foo 1}
(macroexpand '(cond :foo "foo" :else "bar"))
(if :foo "foo" (clojure.core/cond :else "bar"))
((fn [& [{:keys [foo]}]] foo) {:foo 'bar})
bar(def x (with-meta '[1 2 3] {:foo true}))
#'user/x
(assoc [100 101 102 103] 2 :foo)
[100 101 :foo 103]
(lazy-cat (repeat 10 :foo) [(fn [] (print "boom!"))])
(:foo :foo :foo :foo :foo :foo :foo :foo :foo :foo #object [sci.impl.fns$fun$arity_0__26683 0x749f74a1 "sci.impl.fns$fun$arity_0__26683@749f74a1"])
(cons :foo (get {:x (list :xyz)} :x))
(:foo :xyz)
(= (map vals [{:foo 0.1} {:bar 0.1}]))
true(apply identical? (map (constantly [:foo]) (range 2)))
true(some {false true} [1 2 false :foo])
true(condp re-matches "xyz" #"a.*" :foo #"x.*" :bar)
:bar

