(macroexpand '(-> map var .sym name first))
(first (name (.sym (var map))))
(-> {} (assoc :a 1) (assoc :b 3) println)
nil
"{:a 1, :b 3}\n"
(-> {:latitude 1, :longitude 2} ((juxt :latitude :longitude)))
[1 2]
(defn foo ^long [s] (-> ^String s .length))
#'user/foo
(-> {} (assoc 1 :foo) (assoc (long 1) :bar))
{1 :bar}
(-> [-128] byte-array (String. "ISO-8859-1") (.getBytes "ISO-8859-1") seq)
(-128)
(macroexpand-1 '(-> x ((fn [y] (z y)))))
((fn [y] (z y)) x)
(macroexpand '(-> {:a {:b 2}} :a :b))
(:b (:a {:a {:b 2}}))
(-> [x (range 5)] (for (+ x 3)))
(3 4 5 6 7)
(macroexpand '(-> {:1 :a} (keyword (str 1))))
(keyword {:1 :a} (str 1))
(macroexpand-1 '(-> 10 '(1 2 3)))
(quote 10 (1 2 3))
(map #(-> [:p %]) [1 2 3])
([:p 1] [:p 2] [:p 3])
(-> "foo" .getBytes ((partial map #(Integer/toBinaryString %))))
("1100110" "1101111" "1101111")
(-> {:x {:y {:z 5}}} :x :y :z)
5
(-> 1 (+ 2) (* 3) (+ 4))
13
(macroexpand '(-> 1 2 3 4 5))
(5 (4 (3 (2 1))))
(-> (defn foo {:tag `Foo} []) meta :tag class)
clojure.lang.Symbol
(map #(-> {:test %}) [5 10 15])
({:test 5} {:test 10} {:test 15})
(-> 1 (/ 3) (#(- 5 %)))
14/3
(reduce #(-> %2) [1 2 3 4])
4
(-> {:a {:b 20}} :a :b (* 20))
400
(macroexpand '(-> default-trip (add-person "person1") (remove-person "person1")))
(remove-person (add-person default-trip "person1") "person1")
(macroexpand '(-> "bar" #(str "foo" %)))
(fn* "bar" [%1] (str "foo" %1))
(macroexpand '(-> % (fn [x] (:name x))))
(fn % [x] (:name x))
(-> clojure.repl/source-fn var meta ((juxt :file :line :source)))
[nil nil nil]
(macroexpand '(-> :a (fn [x] (str x))))
(fn :a [x] (str x))
(-> 1 (+ 1) (doto prn) (+ 1))
3
"2\n"
(-> 5 ((fn [x] (* x x))) inc)
26
(-> {:a 2, :b 3} seq first class)
clojure.lang.MapEntry
(-> {:fn #(identity 42)} :fn (reduce nil))
42
(str (-> "something.core" namespace-munge (clojure.string/replace \. \/)) ".clj")
"something/core.clj"
(-> [1 2 3] transient (conj! 4) persistent!)
[1 2 3 4]
(macroexpand '(-> 1 2 3 4 5))
(5 (4 (3 (2 1))))
(-> 30 range ((fn [coll] (map inc coll))))
(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30)
(clojure.walk/macroexpand-all '(-> "rhesus macaque" .toUpperCase (map int)))
(map (.toUpperCase "rhesus macaque") int)
(-> "foo" .getBytes String. .toUpperCase .getBytes first char)
\F
(macroexpand '(-> 1 (#(+ % 1))))
((fn* [%1] (+ %1 1)) 1)
(-> {:a 1} (as-> {:keys [a]} (+ a)))
1
(clojure.walk/macroexpand-all '(-> d (c) (b) (a e)))
(a (b (c d)) e)
(-> {:a 1, :b {:c 42}} :b :c)
42
(-> (keyword (str 1)) {:1 2, :3 4})
2
(macroexpand '(-> (range 10) (partial map even?)))
(partial (range 10) map even?)
(macroexpand '(-> [1 2 3] sort reverse))
(reverse (sort [1 2 3]))
(clojure.walk/macroexpand-all '(quote (quote (quote (-> a b)))))
(quote (quote (quote (b a))))
(macroexpand-1 '(-> 1 (fn [x] (inc x))))
(fn 1 [x] (inc x))
(defn macro? [exp] (-> exp var meta :macro))
#'user/macro?
(defmacro ->vec [input fns] `(-> ~input ~@fns))
#'user/->vec
(macroexpand-1 '(-> 1 2 3 4 5))
(5 (4 (3 (2 1))))
(-> [1 2] (with-meta {:x 1}) (seq) (meta))
nil
(-> [] (conj 1) (pop) (conj 2 3) (peek))
3