(for [[sym var] (ns-publics 'clojure.string)] [sym (-> var meta :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\...
(clojure.walk/macroexpand-all '(-> 1 (+ 2) (+ 3) (+ 4)))
(+ (+ (+ 1 2) 3) 4)
(-> {:x {:y {:z [1 2 3]}}} :x :y :z)
[1 2 3]
(clojure.walk/macroexpand-all '(-> 3 (+ 5) (doto prn) (+ 10)))
(+ (clojure.core/let [G__1003211 (+ 3 5)] (prn G__1003211) G__1003211) 10)
(let [f (fn [x] (+ 1 x))] (-> 2 f))
3
(-> {:foo {:bar {:a 3, :b 1}}} :foo :bar :b)
1
(macroexpand-1 '(-> 5 (cons '(6 7 8 9))))
(cons 5 (quote (6 7 8 9)))
(-> {} (assoc :a 1) (assoc :b 2) (assoc :c 3))
{:a 1, :b 2, :c 3}
(macroexpand '(-> 3.0 #(Math/sin %) #(Math/cos %)))
(fn* (fn* 3.0 [%1] (Math/sin %1)) [%1] (Math/cos %1))
(binding [*print-meta* true] (prn (macroexpand '(-> a (#^Integer b)))))
nil
"^{:line 1, :column 56} (^Integer b a)\n"
(-> {} (assoc :foo 1) (assoc :bar 2) (assoc :baz 3))
{:bar 2, :baz 3, :foo 1}
(def x #(-> % (+ 3) (/ 2) inc))
#'user/x
(macroexpand '(let [a 1] (-> 1 inc (* 2))))
(let [a 1] (-> 1 inc (* 2)))
(-> {} (assoc 1 2) (assoc 3 4) (assoc 5 6))
{1 2, 3 4, 5 6}
(macroexpand '(-> [1 2 3] reverse (partial apply vector)))
(partial (reverse [1 2 3]) apply vector)
(-> 5 inc (range) (->> (map #(* % 2))))
(0 2 4 6 8 10)
(-> * (#(%)) inc (doto (->> (def foo))) inc)
3
(let [a {:foo [10 20 30]}] (-> a :foo first))
10
(-> 18 (Integer/toString 2) reverse (->> (apply str)) (Integer/parseInt 2))
9
(defn ^{:ann '[Any -> Any]} foo [x] x)
#'user/foo
(-> {:a 1, :b {:c 2, :d 3}} :b :d)
3
(-> "^{:foo (I am not eval'd)} {}" read-string meta)
{:foo (I am not eval'd)}
(clojure.walk/macroexpand-all '(-> foo (get-in ["foo" "bar"]) (get-in ["bar" "baz"])))
(get-in (get-in foo ["foo" "bar"]) ["bar" "baz"])
(macroexpand-1 (quote (-> 5 (cons (quote (6 7 8 9))))))
(cons 5 (quote (6 7 8 9)))
(binding [*read-eval* true] (read-string "#=(eval (-> 1 inc))"))
2
(-> {:a {:b {:c [1]}}} :a :b :c first inc)
2
(-> + (apply [1 2 3 4]) (->> (* 7)))
70
(-> [2 5 4 1 3 6] reverse rest sort)
(1 2 3 4 5)
(defmacro x [x] (-> &env (find x) first meta :tag))
#'user/x
(-> (iterate #(find % 0) [0 0]) (nth 1000))
[0 0]
(-> {:a 1, :b {:c 2, :d 3}} :a :d)
nil
(macroexpand-1 '(-> x (a b) c (d e f)))
(d (c (a x b)) e f)
(-> 1 (+ 2) (- 5) (+ 8) (+ 2))
8
(defmacro current-function-desc [] `(-> (Throwable.) .getStackTrace ^Object first .toString unmangle))
#'user/current-function-desc
(macroexpand '(-> a (b 1 2) (c 3 4)))
(c (b a 1 2) 3 4)
(let [dfn (with-meta #() {:doc "munger"})] (-> dfn meta :doc))
"munger"
(-> "(def ^:xyz a 1)" read-string second meta)
{:xyz true}
(let [h {:a 1, :b :a}] (-> h :b h))
1
(defmacro fn-> [& forms] `(fn [arg#] (-> arg# ~@forms)))
#'user/fn->
(-> 5 inc inc inc inc inc inc inc inc)
13
(map #(-> (% 2 4)) '(+ - *))
(4 4 4)
(defn rand-pair-from-hashmap [hmap] (-> hmap keys rand-nth ((juxt identity hmap))))
#'user/rand-pair-from-hashmap
(-> 1 (#(+ 1 %)) (#(* 2 %)))
4
(defmacro thread-abcd [actions] `(-> "a b c d" ~@actions))
#'user/thread-abcd
(let [a (atom {1 {:ugh :yay}})] (-> 1 (@a) :ugh))
:yay
(-> 12 inc inc dec (cond-> false (* 23)) inc)
14
(-> * (#(%)) inc (->> (def foo) deref) inc)
3
(-> 7 (/ 0) (try (catch Exception e :haha)) (assert))
nil
(macroexpand '(-> (clojure.string/split "0.0;4e-4;1.2" #";") (map #(Float/parseFloat %))))
(map (clojure.string/split "0.0;4e-4;1.2" #";") (fn* [%1] (Float/parseFloat %1)))
(macroexpand '(-> (range) (filter even?) (take 10) (reduce +)))
(reduce (take (filter (range) even?) 10) +)