(->> (map (juxt first rest next) [() [] #{} {} nil]) (apply =) (iterate true?) (take 3) (every? true?))
true(defn ! [x] (if (zero? x) 1 (apply * ((juxt identity #(! (dec %))) x))))
#'user/!
(->> (map (juxt first rest next) [() [] #{} {} nil]) (apply =) (iterate true?) (take 3) (apply =))
true(list* 'do (for [[k v] {:foo 3, :bar 4}] `(def ~k ~v)))
(do (def :foo 3) (def :bar 4))
(for [[i x] (map vector [:foo :bar :baz] (iterate inc 0))] [i x])
([:foo 0] [:bar 1] [:baz 2])
(format ":foo is a :bar / :qux" {:foo 1, :bar 2, :qux 3})
":foo is a :bar / :qux"(let [m {:foo 42, :bar 23}] (zipmap (keys m) (map inc (vals m))))
{:bar 24, :foo 43}
(let [{:keys [foo bar]} {:foo 1, :bar 2}] (println (str foo "\t" bar)))
nil"1\t2\n"(let [[x y & more] {:foo 1, :bar 2, :baz 3}] (list y))
([:bar 2])
(let [m {:foo 7, :bar 8, :baz 7}] ((group-by m (keys m)) 7))
[:foo :baz]
(apply / ((juxt first (partial apply +)) (map (frequencies (repeatedly 1000 #(rand-nth [true false]))) [true false])))
63/125((juxt (fn [x] (filter even? x)) (fn [x] (filter odd? x))) [1 2 3 4 5])
[(2 4) (1 3 5)]
(apply conj {} (map (juxt :key :value) [{:key "the key", :value "the value"} {:key :a, :value :b}]))
{:a :b, "the key" "the value"}
(map #(map second %) ((juxt filter remove) first (for [i (range 10)] [(odd? i) i])))
((1 3 5 7 9) (0 2 4 6 8))
(map (juxt (comp dec :a) (comp inc :b)) [{:a 1, :b 2} {:a 3, :b 4}])
([0 3] [2 5])
(let [[x y & zs] (range 10)] {:foo x, :bar y, :baz zs})
{:bar 1, :baz (2 3 4 5 6 7 8 9), :foo 0}
(sort-by (comp :upvotes second) {:foo {:upvotes 3}, :bar {:upvotes 5}, :baz {:upvotes 2}})
([:baz {:upvotes 2}] [:foo {:upvotes 3}] [:bar {:upvotes 5}])
(let [map {:foo 42, :bar 23}] (zipmap (keys map) (map str (vals map))))
{:bar 23, :foo 42}
(let [m {:foo 42, :bar 23}] (zipmap (keys m) (map str (vals m))))
{:bar "23", :foo "42"}
(list* 'do (for [[k v] {:foo 3, :bar 4}] `(poop ~k ~v)))
(do (user/poop :foo 3) (user/poop :bar 4))
(map first (take 3 (drop 1 (iterate (fn [[n d]] ((juxt quot rem) n 5)) [85 0]))))
(17 3 0)
(map count ((juxt identity set) (remove #{\space \, \!} "sphinx f black qurtz, jdge my vow!")))
(26 26)
(def predicator (fn [& predicates] #(apply (fn [x y] (and x y)) ((apply juxt predicates) %))))
#'user/predicator
((juxt (comp count filter) (comp count remove)) #(= "1.0" (:added %)) (map meta (vals (ns-publics 'clojure.core))))
[0 538]
((comp (partial apply reduce conj) (juxt (comp first list) (comp range second list))) [:a :b :c] 4)
[:a :b :c 0 1 2 3]
(defmacro x [] (let [name 'y] `(defn ~(with-meta name {:foo :bar}) [] :y)))
#'user/x
((fn [{:keys [foo bar], :or {foo 1, bar 2}}] [foo bar]) {:foo 15})
[15 2]
(let [f {:blah :foo}] (= (with-meta f {:a 0}) (with-meta f {:a 1})))
true(assoc (sorted-map-by #(do (pr %1) (pr %2) -1)) :foo 1 :bar -1)
{:bar -1, :foo 1}
":bar:foo"(let [x {:foo 5}] (for [i x] (str (key i) "=" (val i))))
(":foo=5")
(do (defprotocol IFoo) (defrecord Foo [] IFoo) (let [foo (Foo.)] (assoc foo :foo 'foo)))
#user.Foo {:foo foo}
((fn [arg1 [first-char & xs :as arg2]] [arg1 first-char xs arg2]) :foo "bars")
[:foo \b (\a \r \s) "bars"]
(let [a (atom [{} nil])] (swap! a (fn [[m]] [(assoc m :foo :bar) m])))
[{:foo :bar} {}]
(into {} (map (fn [[k v]] [(str k) (inc v)]) {:foo 12, :bar 34}))
{":bar" 35, ":foo" 13}
(let [{[foo bar] :keys} {:foo 1, :bar 2}] (println (str foo "\t" bar)))
nil"\t\n"(condp (fn [r s] (re-matches r s)) "bar" #"foo" :foo #"bar" :bar :FAIL)
:bar((fn do-print ([obj] (do-print obj obj)) ([obj ret] (do (println obj) ret))) :foo)
:foo":foo\n"(select-keys {:foo 1, :bar 2, :baz {:quux 27, :quizzle 34}} [:bar [:baz :quux]])
{:bar 2}
(let [L (with-meta (seq '(a b)) {:foo :bar})] (meta (conj L 'c)))
{:foo :bar}
(swap! (atom {:foo 17}) (fn [the-map] (if (:non-existent the-map) (assoc the-map :non-existent :bar))))
nil(sorted-map-by (fn [[a] [b]] (< a b)) [1 2] :foo [1 3] :bar)
{[1 2] :bar}
(apply map (juxt #(into %1 %2) #(into %2 %1)) (repeatedly 2 #(shuffle [nil () [] {} #{}])))
([{} nil] [#{} #{}] [() {}] [[] ()] [nil []])
(map (juxt seq? sequential?) [(list 1 2 3) (vector 1 2 3) {:x 1} (seq {:x 1})])
([true true] [false true] [false false] [true true])
(sort-by (comp - :upvotes second) {:foo {:upvotes 3}, :bar {:upvotes 5}, :baz {:upvotes 2}})
([:bar {:upvotes 5}] [:foo {:upvotes 3}] [:baz {:upvotes 2}])
(let [L (with-meta (map identity '(a b)) {:foo :bar})] (meta (conj L 'c)))
nil(map count ((juxt identity set) (remove #{\space \, \!} "sphinx of the black quartz, judge my vow!")))
(32 26)
(let [m {:a 1, :b 2, :c 44} [ks vs] ((juxt keys vals) m)] [vs ks])
[(1 2 44) (:a :b :c)]
(for [i (range (inc (count [1 2 3 4])))] ((juxt take drop) i [1 2 3 4]))
([() (1 2 3 4)] [(1) (2 3 4)] [(1 2) (3 4)] [(1 2 3) (4)] [(1 2 3 4) ()])
(map second (take 3 (drop 1 (iterate (fn [[n d]] ((juxt quot rem) n 5)) [85 0]))))
(0 2 3)
(map (juxt #(% 1) #(% 3)) [[1 2 3 4 5] [:a :b :c :d :e]])
([2 4] [:b :d])

