(->> ["blargfooey" "bardom"] (map (fn [word] (clojure.string/replace word "foo" "bar"))))
("blargbarey" "bardom")
(->> (range 10) (map #(* 2 %)) (reduce +))
90
(->> (range 10) (filter even?) (map inc) (reduce + 0))
25
(->> "/my/test/path/" (drop-while #{\/}) reverse (drop-while #{\/}) reverse)
(\m \y \/ \t \e \s \t \/ \p \a \t \h)
(macroexpand '(->> 5 range (map #(* 2 %))))
(map (fn* [%1] (* 2 %1)) (range 5))
(->> "sdegutis" (distinct) (remove #{\a \e \i \o \u}) (count))
4
(defn distinct-by [f coll] (->> coll (group-by f) (vals) (map first)))
#'user/distinct-by
(macroexpand-1 '(->> 4 (f b) (c) d (e h i)))
(e h i (d (c (f b 4))))
(->> (range 10) (map dec) (take-while #(< % 2)) vec)
[-1 0 1]
(->> (range 20) (remove #(< 5 % 15)) (filter even?))
(0 2 4 16 18)
(macroexpand-1 '(->> x (foo 1) (bar 2 3 4) (baz)))
(baz (bar 2 3 4 (foo 1 x)))
(->> (clojure.string/split "a 1 b 2 c 3" #"\s+") (apply hash-map))
{"a" "1", "b" "2", "c" "3"}
(->> (range 1 7) (filter odd?) (map #(* 2 %)))
(2 6 10)
(->> {:a nil, :b :foo} (filter #(val %)) (reduce merge {}))
{:b :foo}
(->> (repeat 30000 (cons :x [:y])) (apply concat) (reduce (constantly nil)))
nil
(->> {:a 3, :b 2, :c 1} (sort-by val) (map type))
(clojure.lang.MapEntry clojure.lang.MapEntry clojure.lang.MapEntry)
(->> x (for [y (range 10) :let [x (* y y)]]))
(0 1 4 9 16 25 36 49 64 81)
(->> [1 2 3] (reductions conj []) rest (map (partial apply +)))
(1 3 6)
(for [v [500 600 700]] (->> v str reverse (apply str)))
("005" "006" "007")
(->> ["foo" "bar" "baz"] (map-indexed vector) (sort-by second (comp - compare)))
([0 "foo"] [2 "baz"] [1 "bar"])
(macroexpand '((->> [1 2 3] (map inc) #(apply +))))
((->> [1 2 3] (map inc) (fn* [] (apply +))))
(defn distinct-by [f coll] (->> coll (group-by f) vals (map distinct)))
#'user/distinct-by
(->> [[:a [1 2 3]] [:b [4 5]]] first second count)
3
(->> [1 2 3 4 5 6] (map inc) (take 2))
(2 3)
(->> clojure.walk quote ns-publics vals (map meta) (map :doc) (map count))
(201 61 272 180 61 44 93 92 58 182)
(->> (nth (iterate atom 42) 10000) (iterate deref) (drop 10000) (first))
42
(macroexpand '(->> [1 2 3] (map inc) #(apply +)))
(fn* [] (apply +) (map inc [1 2 3]))
(->> clojure.string quote ns-publics vals (map meta) (map (juxt :name :doc)))
([ends-with? "True if s ends with substr."] [capitalize "Converts first character of the string to upper-case, all other\n characters to lower-case."] [reverse "Returns s with its characters reversed."] [join "Returns a string of all elements in coll, as returned by (seq coll),\n separated by an optional separator."] [replace-first "Replaces the first instance of match with replacement in s.\n\...
(->> {:one {:map :in, :another :map}, :two 2} vals (some map?))
true
(-> 30 range (->> (filter even?) (map #(* % %))))
(0 4 16 36 64 100 144 196 256 324 400 484 576 676 784)
(->> [[2 4] [4 343] [5 500]] (map second) (reduce max))
500
(->> (range 10) (map (partial * 2)) (apply str) reverse println)
nil
"(8 1 6 1 4 1 2 1 0 1 8 6 4 2 0)\n"
(macroexpand '(->> coll (map fn1) (map fn2) (filter pred1) first))
(first (filter pred1 (map fn2 (map fn1 coll))))
(->> clojure.string quote ns-publics vals (map meta) (map :doc) (map count))
(27 91 39 107 859 29 198 129 191 26 816 62 34 96 34 212 49 123 44 48 53)
(->> "0221caf96a" (partition 2) (interleave (repeat "%")) (apply concat) (apply str))
"%02%21%ca%f9%6a"
(-> (+ x x) (->> (fn [x]) (update-in {:a 2} [:a])))
{:a 4}
(->> 'clojure.core ns-publics keys (map name) (filter #(.endsWith % "?")))
("decimal?" "contains?" "every?" "qualified-keyword?" "satisfies?" "seq?" "fn?" "vector?" "thread-bound?" "any?" "isa?" "boolean?" "char?" "some?" "inst?" "simple-symbol?" "pos?" "sequential?" "neg?" "reduced?" "float?" "set?" "reversible?" "bound?" "map?" "var?" "empty?" "string?" "uri?" "double?" "map-entry?" "int?" "associative?" "keyword?" "even?" "tagged-literal?" "extends?" "indexed?" "count...
(->> (ns-publics 'clojure.core) keys (filter #(= \? (last (str %)))))
(decimal? contains? every? qualified-keyword? satisfies? seq? fn? vector? thread-bound? any? isa? boolean? char? some? inst? simple-symbol? pos? sequential? neg? reduced? float? set? reversible? bound? map? var? empty? string? uri? double? map-entry? int? associative? keyword? even? tagged-literal? extends? indexed? counted? zero? simple-keyword? not-every? class? neg-int? sorted? nil? instance? b...
(->> "0221caf96a" (partition 2) (apply concat) (interleave (repeat \%)) (apply str))
"%0%2%2%1%c%a%f%9%6%a"
(map #(->> % str reverse (apply str)) [500 600 700])
("005" "006" "007")
(->> 'clojure.core ns-publics (map (comp meta second)) (remove :doc) (map :name))
(macroexpand chunk-first when-first find-ns get-thread-bindings cond->> multi-fn-impl while proxy* satisfies? *print-namespace-maps* ns-unmap newline multi-fn-add-method-impl print-method bound-fn vswap! pr push-thread-bindings remove-ns thread-bound? find-var chunk reify* ns-publics isa? .. munge delay swap-vals! with-bindings *read-eval* multi-fn?-impl -reified-methods *2 eval refer print-dup if...
(->> (range 10) (filter odd?) (remove #(< 3 % 7)))
(1 3 7 9)
(->> {:a 1, :b 2} ((fn [{:keys [a b]}] [a b])))
[1 2]
(->> 3 (- 10) (#(%1 %2) #(- % 5)))
2
(->> clojure.core quote ns-interns (filter (comp :private meta val)) (map key))
()
(->> '+ resolve meta ((juxt :ns :name)) (map str) (apply symbol))
clojure.core/+
(defn taco-bell-recipe [] (->> (concat (->> ["flour tortilla" "corn tortilla" "chips" "gordita" "rice"] shuffle (take (rand-int 4))) (->> ["onions" "beans" "cheese" "beef" "chicken" "lettuce" "tomatoes" "enchilada sauce" "sour cream" "guacamole" "nacho cheese"] shuffle (take (rand-int 10)))) (clojure.string/join ", ")))
#'user/taco-bell-recipe
(reduce + 1 (->> [3 4 5] (map inc) (filter even?)))
11
(macroexpand '(->> (range 10) (map inc) (reduce +)))
(reduce + (map inc (range 10)))
(->> (range) (filter even?) (map #(* 2 %)) (take 4))
(0 4 8 12)