(into {} (map (juxt identity symbol?) [:a (symbol (str :a))]))
{:a false, :a true}
(let [separate (juxt filter remove)] (separate even? (range 10)))
[(0 2 4 6 8) (1 3 5 7 9)]
(into {} (map (juxt val key) {:a 1, :b 2}))
{1 :a, 2 :b}
((juxt filter remove) #{1 3 4} (range 5))
[(1 3 4) (0 2)]
(apply interleave ((juxt keys vals) {:a 1, :b 2}))
(:a 1 :b 2)
(filter (juxt identity println) '(0 1 2 3))
(0 1 2 3)
"0\n1\n2\n3\n"
(map (juxt inc dec identity) [0 1 2 3])
([1 -1 0] [2 0 1] [3 1 2] [4 2 3])
(-> 10 vector (with-meta {:name "frank"}) ((juxt first meta)))
[10 {:name "frank"}]
(apply = (map (juxt first rest next) [() [] #{} {} nil]))
true
((juxt #(first (filter even? %)) identity) (range 4))
[0 (0 1 2 3)]
(def group-by-vals (comp (partial apply group-by) (juxt identity keys)))
#'user/group-by-vals
((juxt + * - /) 1 2 3 4)
[10 24 -8 1/24]
(let [tf (juxt + - *)] (tf 1 2))
[3 -1 2]
(map (juxt seq not-empty) [[] [1 2] () '(1 2)])
([nil nil] [(1 2) [1 2]] [nil nil] [(1 2) (1 2)])
(for [i (range 3)] ((juxt dec identity inc) i))
([-1 0 1] [0 1 2] [1 2 3])
(nth (iterate (juxt first rest) '[first rest]) 10)
[first ((((((((((rest))))))))))]
(map (juxt pos? zero? neg?) [1 0.0 -0.0 -1])
([true false false] [false true false] [false true false] [false false true])
(map (juxt seq? coll? vector? list?) '(() [] (range 10)))
([true true false true] [false true true false] [true true false true])
((juxt (fn [x] (meta x)) meta) ^:meta {:foo :bar})
[{:meta true} {:meta true}]
((juxt :b :d) {:a 5, :b 6, :d 9})
[6 9]
((juxt filter remove) pos? [-1 2 -3 4 -5])
[(2 4) (-1 -3 -5)]
(map (juxt inc dec inc dec) [1 2 3])
([2 0 2 0] [3 1 3 1] [4 2 4 2])
(defn valid_user? [u] (every? some? ((juxt :email :name) u)))
#'user/valid_user?
(defmacro mapmap [ss] (into {} (map (juxt keyword identity) ss)))
#'user/mapmap
(apply compare (map (juxt :time identity) '[a b]))
-1
((juxt reduce apply) (partial list '+) [1 2 3])
[(+ (+ 1 2) 3) (+ 1 2 3)]
(defn palindrome? [p] (apply = ((juxt reverse seq) p)))
#'user/palindrome?
(apply (juxt min max) [9 10 2 7 4])
[2 10]
((juxt (comp first list) (comp second list)) 'a 'b)
[a b]
(let [m {:a 1, :b 2, :c 3, :d 4}] ((juxt :a (apply juxt (disj (set (keys m)) :a))) m))
[1 [3 2 4]]
(into {} (map (juxt key (comp inc val))) {:a 1})
{:a 2}
(map (juxt key (comp :doc meta val)) (ns-publics 'clojure.set))
([union "Return a set that is the union of the input sets"] [map-invert "Returns the map with the vals mapped to the keys."] [join "When passed 2 rels, returns the rel corresponding to the natural\n join. When passed an additional keymap, joins on the corresponding\n keys."] [select "Returns a set of the elements for which pred is true"] [intersection "Return a set that is the intersection of th...
((juxt = not= < <= > >=) Double/NaN 4)
[false true false false false false]
((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])
((juxt :foo :baz) {:bar 2, :baz 3, :foo 1})
[1 3]
(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]}
(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]}
(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 :x :y) {:x 0, :y 1, :z 2})
[0 1]
(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)