(-> '(defn f [a b] (+ a b)) (nth 3))
(+ a b)
(-> "foo" .getBytes ((partial map int)) ((partial map #(Integer/toBinaryString %))))
("1100110" "1101111" "1101111")
(-> 2 (partition 2 '(+ 4 * 3 - 7)))
((+ 4) (* 3) (- 7))
(let [meth #(.indexOf %1 %2)] (-> "hello" (meth (int \e))))
1
(some #(-> % :some :params list set) [1 2 3])
#{nil}
(defn process-in-context [code-string] (binding [*ns* (the-ns "my.system")] (-> code-string read-string eval)))
#'user/process-in-context
(clojure.walk/macroexpand-all '(-> (now) year (date-time 1 1) (interval (now)) in-secs))
(in-secs (interval (date-time (year (now)) 1 1) (now)))
(defmacro foo [& args] (-> `(sdlkl ~args) (with-meta (meta &form))))
#'user/foo
(-> 2 (* 3) (cond-> (= 1 2) inc) (* 2))
12
(-> [2 5 4 1 3 6] reverse rest sort last)
5
(macroexpand '(doto foo (if (then-this) (else-that)) (-> fn1 fn2 fn3)))
(clojure.core/let [G__3394615 foo] (if G__3394615 (then-this) (else-that)) (-> G__3394615 fn1 fn2 fn3) G__3394615)
(macroexpand `(-> 3 inc dec (as-> b [b (- b)])))
(clojure.core/let [user/b (clojure.core/dec (clojure.core/inc 3))] [user/b (clojure.core/- user/b)])
(binding [*print-meta* true] (prn (macroexpand '^String (-> ^Foo x (identity)))))
nil
"^{:line 1, :column 69} (identity ^Foo x)\n"
(-> {} ((partial repeat 2)) vec (update-in [0] ifn?) (update-in [1] fn?))
[true false]
(-> [1 2 3] (->> (mapv inc)) (as-> x (x 0)))
2
(-> (for [x (range 5)] (do (println x) x)) seq boolean)
true
"0\n1\n2\n3\n4\n"
(-> (+ x x) (->> (fn [x]) (update-in {:a 0} [:a])))
{:a 0}
(some #(when (-> % :id #{456}) %) [{:id 456}])
{:id 456}
(-> [1 2 3 4 1] frequencies (get 1) (= 1))
false
(macroexpand '(map #(-> + 1 %) [1 2 3]))
(map (fn* [%1] (-> + 1 %1)) [1 2 3])
(defmacro heck-> ([x] x) ([x form] `(-> ~x ~form)) ([x form1 form2] `(let [x1# ~x x2# (-> x1# ~form1)] (-> (if (nil? x2#) x1# x2#) ~form2))) ([x form1 form2 & more] `(heck-> (heck-> ~x ~form1 ~form2) ~@more)))
#'user/heck->
(-> '{:k1 "stuff", :k2 ["1" "2"]} (update-in [:k2] conj "3"))
{:k1 "stuff", :k2 ["1" "2" "3"]}
(-> [2 5 4 1 3 6] reverse rest sort first)
1
(-> (apply max-key val {:a 1, :b 2, :c 3}) key)
:c
(-> {:a 5, :b 6, :d 9} (select-keys [:b :d]) vals)
(6 9)
(-> (seq [3 4 5]) (with-meta {:my :meta}) (conj 2) meta)
nil
(let [f (partial apply vector)] (-> [1 2 3] reverse f))
[3 2 1]
(map #(-> % range sort type) [1 10 1000 1000000])
(clojure.lang.ArraySeq clojure.lang.ArraySeq clojure.lang.ArraySeq clojure.lang.ArraySeq)
(-> '(fred f #^{:a 7} 'bar) (nth 2) meta)
{:a 7}
(-> 1 (* 2) (+ 8) (as-> x (- 1 x)))
-9
(macroexpand-1 '(-> x (foo 1) (bar 2 3 4) (baz)))
(baz (bar (foo x 1) 2 3 4))
(do (defrecord RecordType [property]) (def instance (RecordType. 42)) (-> instance .property))
42
(-> (for [x (range 100)] (do (println x) x)) seq boolean)
true
"0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n"
(-> "(^:awesome f [x] (inc x))" read-string first meta)
{:awesome true}
(-> '(3 4 5) (with-meta {:my :meta}) (conj 2) meta)
{:my :meta}
(let [the-map {:fn #(inc %)}] (-> the-map :fn (deliver 5)))
6
(-> {:a 0, :b 1} (update-in [:a] inc) (update-in [:b] dec))
{:a 1, :b 0}
(count "(fn loop [_] (-> (read) eval prn loop))")
39
(-> #'first str (clojure.string/split #"/") last clojure.string/reverse (str ":") clojure.string/reverse read-string)
:first
(let [t {:a {:b {:c 1}}}] (-> t :a :b :c))
1
(defn factorial [n] (-> n (+ 1) (range 1) (apply *)))
#'user/factorial
(-> 41 atom atom atom atom (swap! swap! swap! swap! inc))
42
(clojure.walk/macroexpand-all '(-> "two words" #(clojure.string/split % #" ") last))
(last (fn* "two words" [%1] (clojure.string/split %1 #" ")))
((-> 1 ((partial partial inc)) ((fn [x] #(doto (x) prn)))))
2
"2\n"
(-> 2 (* 3) (cond-> (= 1 1) inc) (* 2))
14
(-> 321 Integer/toString ((partial repeat 2)) ((juxt first (comp reverse second))))
["321" (\1 \2 \3)]
(map key (filter #(-> % val deref fn?) (ns-publics 'clojure.core)))
(+' decimal? sort-by macroexpand chunk-first eduction tree-seq unchecked-remainder-int seq reduce when-first find-ns get-thread-bindings contains? every? keep-indexed cond->> subs set multi-fn-impl take-last bit-set qualified-keyword? while ->Eduction proxy* butlast satisfies? line-seq unchecked-subtract-int take-nth first re-groups seq? dec' ns-unmap with-bindings* inst-ms iterator-seq iterate ne...
(-> [2 5 4 1 3 6] reverse rest sort second)
2
(let [a {:foo [10 20 30]}] (-> a :foo (nth 1)))
20
(-> {:foo 1, :bar 2} (update-in [:foo] inc) (update-in [:bar] inc))
{:bar 3, :foo 2}