(-> 5 (+ 2) (+ 3) (+ 10))
20
(-> (iterate (partial * 2) 1) (nth 8))
256
(macroexpand-1 '(-> x ((fn [y] (inc y)))))
((fn [y] (inc y)) x)
(-> + (partial 7) (partial 4) (deliver 9))
20
(-> "(+ 1 2 3)" read-string eval)
6
(macroexpand '(-> [1 2 3] #(seq %)))
(fn* [1 2 3] [%1] (seq %1))
(let [- = _ 1] (-> (- _ -)))
false
(macroexpand (-> 5 (cons '(6 7 8 9))))
(5 6 7 8 9)
(-> [[1 2] [3 4]] (get 1) (get 0))
3
(macroexpand '(-> 1 inc dec (partial * 10)))
(partial (dec (inc 1)) * 10)
(-> '(->> :a :b (->> :c :d)) macroexpand-1)
(->> :c :d (:b :a))
(-> {:foo 0} (update :foo inc) (assoc :bar 10))
{:bar 10, :foo 1}
(map #(-> %&) (range 10) (range 20 100))
((0 20) (1 21) (2 22) (3 23) (4 24) (5 25) (6 26) (7 27) (8 28) (9 29))
(-> (iterate #(/ % 13) 7) (nth 17))
7/8650415919381337933
(macroexpand '(-> 25 #(+ % 1) int))
(int (fn* 25 [%1] (+ %1 1)))
(macroexpand '(-> 10 (fn [x] (+ 1 x))))
(fn 10 [x] (+ 1 x))
(-> {:this :is, :my :map} (vary-meta assoc :type :sdegutis))
{:my :map, :this :is}
(-> {:foo "foo"} (assoc :bar "bar") (update :foo clojure.string/reverse))
{:bar "bar", :foo "oof"}
(macroexpand `(-> {:a 0, "b" 4} (get "b")))
(clojure.core/get {:a 0, "b" 4} "b")
(macroexpand '(doto instance (-> (. field) (set! 10))))
(clojure.core/let [G__108374 instance] (-> G__108374 (. field) (set! 10)) G__108374)
(macroexpand '(-> {} (assoc :a 1) (assoc :b 2)))
(assoc (assoc {} :a 1) :b 2)
(macroexpand '(-> (select* widgets) (where {:id 1}) (select)))
(select (where (select* widgets) {:id 1}))
(-> 123 str ((partial map str)) ((partial map read-string)))
(1 2 3)
(let [w "reduce"] (-> w symbol resolve meta (#'clojure.repl/print-doc)))
nil
"-------------------------\nclojure.core/reduce\n([f coll] [f val coll])\n f should be a function of 2 arguments. If val is not supplied,\n returns the result of applying f to the first 2 items in coll, then\n applying f to that result and the 3rd item, etc. If coll contains no\n items, f must accept no arguments as well, and reduce returns the\n result of calling f with no arguments. If col...
(macroexpand-1 (-> 5 (cons '(6 7 8 9))))
(5 6 7 8 9)
(macroexpand '(-> (a b) (c d) (e f)))
(e (c (a b) d) f)
(defn remoteeval [request] (-> request :params :expression load-string str))
#'user/remoteeval
(macroexpand '(-> ([x y] (+ x y)) #()))
(fn* ([x y] (+ x y)) [] ())
(-> 10 vector (with-meta {:name "frank"}) ((juxt first meta)))
[10 {:name "frank"}]
(-> [] (conj 1) (into [2 3 4]) (conj 5))
[1 2 3 4 5]
(macroexpand '(-> 1 (fn [x] (+ 1 x))))
(fn 1 [x] (+ 1 x))
(map #(-> % str read-string) [\1 \2 \3])
(1 2 3)
(print (str \$ "(-> 5 (+ 2))"))
nil
"$(-> 5 (+ 2))"
(-> (+ 1 2) (as-> three (+ 1 three)))
4
(macroexpand '(-> 1 inc (println "is the number")))
(println (inc 1) "is the number")
(-> {:a [0 2 42 3]} :a (get 2))
42
(macroexpand '(-> foo (fn [x] (prn x) x)))
(fn foo [x] (prn x) x)
(-> 1 inc (#(do (println %) %)) inc)
3
"2\n"
(-> 3 (+ 5) (->> (- 100)) (* 2))
184
(-> #'realized? meta :arglists first first meta :tag type)
clojure.lang.Symbol
(macroexpand '(-> long (very and boring) (a story)))
(a (very long and boring) story)
(macroexpand-1 '(-> 1 #(+ % 2 3)))
(fn* 1 [%1] (+ %1 2 3))
(macroexpand-1 '(-> (new FileWriter #^File file-spec) (new BufferedWriter)))
(new (new FileWriter file-spec) BufferedWriter)
(map #(-> % class ancestors count) ['a :a])
(11 8)
(-> 'd (list (map symbol '(a b c))))
(d (a b c))
(macroexpand '(-> (+ 1 2) dec (* 5)))
(* (dec (+ 1 2)) 5)
(meta (-> [2 3] (with-meta {:foo :bar}) (conj 8)))
{:foo :bar}
(-> [1 2] (as-> x (do (println x) x)))
[1 2]
"[1 2]\n"
(macroexpand '(-> x foo bar (baz 3 4)))
(baz (bar (foo x)) 3 4)
(clojure.walk/macroexpand-all '(-> 1 inc dec (partial * 10)))
(partial (dec (inc 1)) * 10)