(((fn [n] (fn [x] (apply * (repeat n x)))) 2) 16) 256or
((partial (fn [n x] (apply * (repeat n x))) 2) 16) 256
(((fn [n] (fn [x] (apply * (repeat n x)))) 2) 16) 256or
((partial (fn [n x] (apply * (repeat n x))) 2) 16) 256
((fn [kvect, vvect] (apply hash-map (interleave kvect vvect))) [:a :b :c] [1 2 3]) {:c 3, :b 2, :a 1}
((fn [s n] (mapcat (fn [x] (repeat n x)) s)) [1 2 3] 2) ((1 1 2 2 3 3))
((fn interlive [s1 s2] (mapcat vector s1 s2)) [:a :b :c] [1 2 3]) (:a 1 :b 2 :c 3)
((fn flat [s] (if (sequential? s) (mapcat flat s) [s])) '((1 2) 3 [4 [5 6]])) (1 2 3 4 5 6)
(#(map first (partition-by identity %)) [1 1 2 3 3 2 2 3]) [1 2 3 2 3]
((fn [n] (map second (take n (iterate (fn [[a b]] [b (+ a b)]) [0 1])))) 6) (1 1 2 3 5 8)
((fn [defval vect] (reduce (fn [m k] (conj m {k defval})) {} vect)) 0 [:a :b]) {:a 0, :b 0}or
((fn [defval vect] (zipmap vect (repeat defval))) 0 [:a :b :c]) {:a 0, :b 0, :c 0}
(reduce (fn [m [k v]] (assoc m k (inc v))) {} {:a 1 :b 2}) {:a 2, :b 3}NB: In this example, reduce treats the argument {:a 1 :b 2} as a sequence of vectors, like ([:a 1] [:b 2])
(reduce-kv (fn [m k v] (assoc m k (inc v))) {} {:a 1 :b 2}) {:a 2, :b 3}