(-> '(and a b c d) macroexpand-1 macroexpand-1 macroexpand-1)
(and a b c d)
(-> '(1 2 3 4) rest rest rest first)
4
(-> '^^^private private private private meta :tag meta :tag meta)
{:tag private}
(defmacro fn-> [& more] `(fn [x#] (-> x# ~@more)))
#'user/fn->
(#'-> '(-> x y z) nil 'x 'y 'z)
(z (y x))
(-> 7 inc dec (as-> y (+ y y)) inc)
15
(-> {:a [1 2 3 4]} :a (->> (map inc)))
(2 3 4 5)
(-> {:one 1} ((fn [{:keys [one]}] (println "one is" one))))
nil
"one is 1\n"
(macroexpand-1 '(-> dna (fn [x] (map f x)) foo))
(foo (fn dna [x] (map f x)))
((fn [n] (-> n ((if (even? n) identity inc)))) 3)
4
(let [f (comp symbol name)] (-> {:name "foo"} :name f))
foo
(macroexpand-1 '(-> {:lat 1, :long 2} (juxt :lat :long)))
(juxt {:lat 1, :long 2} :lat :long)
((partial assoc {:text "flarp"} :id) (-> {:foo 45} vals first))
{:id 45, :text "flarp"}
(let [f (juxt key val)] (-> {1 2} first f))
[1 2]
(defmacro x [& coll#] `(-> (last '~coll#) (list ~@coll#)))
#'user/x
(meta (-> [2 3] (with-meta {:foo :bar}) (conj 8) (empty)))
{:foo :bar}
(-> inc inc inc inc inc inc inc inc quote)
(inc (inc (inc (inc (inc (inc (inc inc)))))))
(-> {:foo 45} vals first (->> (assoc {:text "flarp"} :id)))
{:id 45, :text "flarp"}
(binding [*print-meta* true] (prn (macroexpand '(-> a #^Integer (b)))))
nil
"^{:tag Integer, :line 1, :column 55} (b a)\n"
(defn next-po10 [n] (-> n (quot 10) inc (* 10)))
#'user/next-po10
(macroexpand '(-> (select* widgets) (if true (where {:id 1}))))
(if (select* widgets) true (where {:id 1}))
(macroexpand-1 '(-> dna ((fn [x] (map f x))) foo))
(foo ((fn [x] (map f x)) dna))
(clojure.walk/macroexpand-all '(-> (one) (case 1 (two) 2 (three)) (four)))
(four (case (one) 1 (two) 2 (three)))
(symbol (clojure.string/join "/" ((juxt :ns :name) (-> 'println resolve meta))))
clojure.core/println
(-> 1 inc (as-> n (* n n) (inc n)))
5
(-> (map #(delay (prn %)) (range)) (nth 3) force)
nil
"3\n"
(-> (iterate #(*' 2 %) 7) (nth 383) type)
clojure.lang.BigInt
(macroexpand '(-> foo (get-in ["foo" "bar"]) (get-in ["bar" "baz"])))
(get-in (get-in foo ["foo" "bar"]) ["bar" "baz"])
(-> (fn [a] (+ a a)) ((fn [f] (f 1))))
2
(macroexpand '(-> (iterate (partial * 2) 1) (nth 8)))
(nth (iterate (partial * 2) 1) 8)
(-> [1 2 3 4] frequencies (get 1) (= 1))
true
(-> 1 inc (as-> x (reduce + x [2 3])))
7
(defmacro arglist [action] `(-> ~action var meta :arglists first))
#'user/arglist
(count "(-> [:foo] first name symbol list str)")
38
(macroexpand '(->> "one two" (-> (clojure.string/split #" ")) count))
(count (-> (clojure.string/split #" ") "one two"))
(-> {:a 1, :b 2} (dissoc :a) (update-in [:b] inc))
{:b 3}
(defmacro debug-> [& xs] `(-> ~@(interleave xs (repeat 'print))))
#'user/debug->
(-> (transient {}) (#(if true (assoc! % :a 'a) %)) persistent!)
{:a a}
(-> {"a" {"b" {"c" 1}}} (get "a") (get "b") (get "c"))
1
(macroexpand '(-> (clojure.core/deref bot) :config :prepends first str (second x)))
(second (str (first (:prepends (:config (clojure.core/deref bot))))) x)
(let [m {:a {:b {:c :hello}}}] (-> m :a :b :c))
:hello
(-> 30 range (->> (filter even?) (map #(* % %))))
(0 4 16 36 64 100 144 196 256 324 400 484 576 676 784)
(macroexpand '(-> {:foo 0} (update :foo inc) (assoc :bar 10)))
(assoc (update {:foo 0} :foo inc) :bar 10)
(-> {:a 1, :b 2} (update-in [:a] inc) (update-in [:b] dec))
{:a 2, :b 1}
(macroexpand '(-> ["one"] first (fn [x] (str x "_")) keyword))
(keyword (fn (first ["one"]) [x] (str x "_")))
(defn select-rename [map keymap] (-> map (select-keys (keys keymap)) (clojure.set/rename-keys keymap)))
#'user/select-rename
(-> " foo bar baz_quux" clojure.string/trim (clojure.string/replace #"(\s+|-|_)" "-"))
"foo-bar-baz-quux"
(-> {:a [0 1 2 {:b "c"}]} :a (nth 3) :b)
"c"
(macroexpand-1 '(-> ["one"] first (fn [x] (str x "_")) keyword))
(keyword (fn (first ["one"]) [x] (str x "_")))
(-> (+ x x) (->> (fn [x]) (update-in {:a 2} [:a])))
{:a 4}