(into {} (map (juxt (comp keyword hash) identity) ["a" "b" "c"]))
{nil "c"}
((juxt map filter) #{1 4 7 10} (range 10))
[(nil 1 nil nil 4 nil nil 7 nil nil) (1 4 7)]
(let [do-math (juxt + - * /)] (do-math 10 20))
[30 -10 200 1/2]
((juxt #(+ 1 %1) #(* 2 %1)) 3)
[4 6]
(map (juxt inc dec #(* 3 %)) (range 4))
([1 -1 0] [2 0 3] [3 1 6] [4 2 9])
(map #(take 3 %) ((juxt filter remove) even? (range)))
((0 2 4) (1 3 5))
((juxt take drop) 2 [1 2 4 5 6 7])
[(1 2) (4 5 6 7)]
(into {} (map (juxt (comp {:id :ID} first) second) {:id 1}))
{:ID 1}
((juxt take drop) 4 [1 2 3 4 5 6])
[(1 2 3 4) (5 6)]
(clojure.string/join " " ((juxt :first :last) {:first "Bob", :last "Smith"}))
"Bob Smith"
(zipmap [:mod :dividend] ((juxt mod (comp int /)) 10 100))
{:dividend 0, :mod 10}
(macroexpand-1 '(-> {:lat 1, :long 2} (juxt :lat :long)))
(juxt {:lat 1, :long 2} :lat :long)
(let [f (juxt key val)] (-> {1 2} first f))
[1 2]
((juxt :a :b :c) {:a 1, :b 2, :c 3})
[1 2 3]
((comp (partial into {}) (partial map (juxt count identity))) ["yes" "no"])
{2 "no", 3 "yes"}
(symbol (clojure.string/join "/" ((juxt :ns :name) (-> 'println resolve meta))))
clojure.core/println
((juxt #(/ % 60) #(rem % 60)) 1019)
[1019/60 59]
(first ((apply juxt (conj (vec (repeat 500 inc)) println)) 4))
5
"4\n"
(->> [1 2] ((juxt (comp dec first) (comp inc second))))
[0 3]
(map (juxt sequential? map? set? list? vector? seq?) [() [] #{} {} (lazy-seq)])
([true false false true false true] [true false false false true false] [false false true false false false] [false true false false false false] [true false false false false true])
(clojure.string/join \. ((juxt :a :c) {:a "apple", :b "banana", :c "cherry"}))
"apple.cherry"
(into {} (map (comp (juxt :name :doc) meta)) (vals (ns-publics (the-ns 'clojure.core))))
{+' "Returns the sum of nums. (+') returns 0. Supports arbitrary precision.\n See also: +", decimal? "Returns true if n is a BigDecimal", sort-by "Returns a sorted sequence of the items in coll, where the sort\n order is determined by comparing (keyfn item). If no comparator is\n supplied, uses compare. comparator must implement\n java.util.Comparator. Guaranteed to be stable: equal element...
(into {} (map (juxt identity {:a 1, :b 2}) [:a :b :c]))
{:a 1, :b 2, :c nil}
(map (juxt first second) `[[a 1] [b 2] [c 3]])
([user/a 1] [user/b 2] [user/c 3])
((juxt identity meta) (tree-seq seq? identity '(with-meta [1] {:m 1})))
[((with-meta [1] {:m 1}) with-meta [1] {:m 1}) nil]
(let [ks '(a b)] (into {} (map (juxt keyword identity) ks)))
{:a a, :b b}
(map #((juxt inc dec) %) [1 2 3 4 5])
([2 0] [3 1] [4 2] [5 3] [6 4])
((juxt (partial apply max) (partial apply +)) [1 2 4 3])
[4 10]
((juxt (comp first filter) some) pos? [0 -1 2 1 0])
[2 true]
(let [[q r] ((juxt quot rem) 43870 3600)] (prn [q r]))
nil
"[12 670]\n"
(nth (iterate (comp #(apply hash-map %) (juxt identity identity)) {}) 4)
{{{{{} {}} {{} {}}} {{{} {}} {{} {}}}} {{{{} {}} {{} {}}} {{{} {}} {{} {}}}}}
(= get (apply get ((juxt get get get) get get get)))
true
(map (juxt class ifn?) [inc [] (symbol "foo") :foo "str" #"re" {} #{} ()])
([clojure.core$inc true] [clojure.lang.PersistentVector true] [clojure.lang.Symbol true] [clojure.lang.Keyword true] [java.lang.String false] [java.util.regex.Pattern false] [clojure.lang.PersistentArrayMap true] [clojure.lang.PersistentHashSet true] [clojure.lang.PersistentList$EmptyList false])
(let [keys [:a :b]] (zipmap keys ((apply juxt keys) {:a 1})))
{:a 1, :b nil}
((juxt :c :d) {:a 1, :c 2, :d 7, :e -2})
[2 7]
((juxt (fn ([] :nullary-a) ([& _] :varity-a)) (fn ([& _] :varity-b) ([] :nullary-b))))
[:nullary-a :nullary-b]
(let [m ["the" "quick" "brown" "fox"]] ((juxt first last) (sort m)))
["brown" "the"]
(map #(juxt inc dec %) [1 2 3 4 5])
(#object[clojure.core$juxt$fn__5893 0x38ebf96b "clojure.core$juxt$fn__5893@38ebf96b"] #object[clojure.core$juxt$fn__5893 0x362c1006 "clojure.core$juxt$fn__5893@362c1006"] #object[clojure.core$juxt$fn__5893 0x3213921b "clojure.core$juxt$fn__5893@3213921b"] #object[clojure.core$juxt$fn__5893 0x77111a3d "clojure.core$juxt$fn__5893@77111a3d"] #object[clojure.core$juxt$fn__5893 0x10d69515 "clojure.core...
(defn vals->vector [m] (into {} (map (juxt key (comp vector val)) m)))
#'user/vals->vector
(map (juxt (comp name str) (comp str name)) ["foo" 'foo :foo])
(["foo" "foo"] ["foo" "foo"] [":foo" "foo"])
(->> '+ resolve meta ((juxt :ns :name)) (map str) (apply symbol))
clojure.core/+
(map (juxt :a :b) [[:a 1 :b2] [:a 5 :b 7]])
([nil nil] [nil nil])
(defn deconcat [coll] ((juxt take drop) (rand-int (inc (count coll))) coll))
#'user/deconcat
(map (juxt (partial + 1) (partial + 2)) [1 2 3])
([2 3] [3 4] [4 5])
(map (juxt + - *) [1 2 3] [10 20 30])
([11 -9 10] [22 -18 40] [33 -27 90])
(defn juxtcat [& args] (comp (partial apply concat) (apply juxt args)))
#'user/juxtcat
((juxt = list) (hash-map Double/NaN Double/NaN) (hash-map Double/NaN Double/NaN Double/NaN Double/NaN))
[false ({##NaN ##NaN} {##NaN ##NaN, ##NaN ##NaN})]
(map (apply juxt (map (partial partial +) (range 5))) (range 5))
([0 1 2 3 4] [1 2 3 4 5] [2 3 4 5 6] [3 4 5 6 7] [4 5 6 7 8])
(read-string (pr-str (into {} (map (juxt identity symbol?) [:a (keyword (name :a))]))))
{:a false}
((fn rle [s] (map (juxt count first) (partition-by identity s))) "111111222222333333abccccd")
([6 \1] [6 \2] [6 \3] [1 \a] [1 \b] [4 \c] [1 \d])