(apply concat ((juxt take-while (comp rest drop-while)) #(not= 4 %) [1 2 3 4 5 6 7 8 9]))
(1 2 3 5 6 7 8 9)
(apply (fn [a b] (a b)) ((apply juxt (map (fn [length] (comp second #(nth % length))) [27 15])) (filter (comp #{\?} last name first) (seq (ns-map *ns*)))))
false
(let [m {:a 1, :b 2, :c 3}] (into (empty m) (map (juxt key (comp (partial * 10) val)) m)))
{:a 10, :b 20, :c 30}
(#(map (apply juxt %&) (apply clojure.set/intersection (map (comp set keys) %&))) {:a 1, :c 6} {:b 2, :c 3})
([6 3])
(map (comp (partial apply hash-map) (juxt :k :v)) [{:k 1, :v 2} {:k 3, :v 4} {:k 5, :v 6}])
({1 2} {3 4} {5 6})
((juxt (partial take-nth 2) (comp (partial take-nth 2) rest)) [1 '+ 2 '* 3 '+ 4 '/ 5 '+ 6])
[(1 2 3 4 5 6) (+ * + / +)]
(sort-by (juxt (comp count :key) :otherkey) [{:key '(1 2 3 4), :otherkey 10} {:key '(1 2 3), :otherkey 12}])
({:key (1 2 3), :otherkey 12} {:key (1 2 3 4), :otherkey 10})
(sort-by (juxt :otherkey (comp count :key)) [{:key '(1 2 3 4), :otherkey 10} {:key '(1 2 3), :otherkey 12}])
({:key (1 2 3 4), :otherkey 10} {:key (1 2 3), :otherkey 12})
(reduce into ((juxt vec #(apply map list %) (comp list (partial map-indexed #(nth %2 %)))) (partition 3 (range 9))))
[(0 1 2) (3 4 5) (6 7 8) (0 3 6) (1 4 7) (2 5 8) (0 4 8)]
(let [f #(if (= % 7) [:hi 6 6] :hi) g inc h inc] (= ((comp f g h) 5) ((juxt f g h) 5)))
true
(->> rand repeatedly (partition 4) (take 20) (map (juxt identity #(apply hash-map %))) (map #(map (comp flatten seq) %)) (map #(apply = %)) set)
#{false true}
((comp (juxt :accum :result) reduce) (fn [{:keys [accum result]} x] {:accum (conj accum x), :result (conj result (accum x))}) {:accum #{}, :result []} [:a :b :b :c :d :c])
[#{:a :b :c :d} [nil nil :b nil nil :c]]
(let [sym (gensym) h #(with-meta % {sym true}) g #(if (-> % meta sym) (constantly %) %) f #(if (fn? %) [(%) (%) (%)] %) x 'foo] (= ((comp f g h) x) ((juxt f g h) x) [x x x]))
true
(let [gross (reify Object (equals [_ x] true)) f #(if (identical? % gross) [gross gross gross] gross) g (constantly gross) h (constantly gross) x 5/19] (= ((comp f g h) x) ((juxt f g h) x) [x x x]))
false