(do (require '[clojure.walk :as walk]) (walk/macroexpand-all '(quote (let [a 1] a))))
(quote (let [a 1] a))
(let [digits (fn [n] (map #(Integer/parseInt (str %)) (str n)))] (digits 1234))
(1 2 3 4)
(let [nums (range 3) [x y z] nums] (+ x y z))
3(let [coll '(1 3 2 4 6)] (map - (rest coll) coll))
(2 -1 2 2)
(let [[a & [b & c]] [1 2 3 4]] [a b c])
[1 2 (3 4)]
(let [completions '(foo bar baz)] [(interpose "\n" completions) (interleave completions (repeat "\n"))])
[(foo "\n" bar "\n" baz) (foo "\n" bar "\n" baz "\n")]
(binding [*print-meta* true] (macroexpand '(let [foo ^{f ?, w t} []] foo)))
(let [foo []] foo)
(let [{:syms [a b c]} '{a 1, b 2, c 3}] b)
2(let [x [1 2 3 4]] (concat (take 2 x) (drop 3 x)))
(1 2 4)
(let [m (transient {})] (doseq [i (range 20)] (assoc! m i i)) (persistent! m))
{0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7}
(let [m ["the" "quick" "brown" "fox"]] (apply (partial (juxt max-key min-key) count) m))
["brown" "fox"]
(let [[x y & more] {:foo 1, :bar 2, :baz 3}] (list y))
([:bar 2])
(let [good+ (fn [& args] (apply + (shuffle args)))] (good+ 7 8 9))
24(let [𝛂 2 𝛃 3] (println "𝛂 + 𝛃 =" (+ 𝛂 𝛃)))
nil"𝛂 + 𝛃 = 5\n"(let [a (atom 0) b (seque 5 (repeatedly #(swap! a inc)))] @a)
0(let [f (fn [coll] (into (empty coll) [[1 2] [3 4]]))] [(f {}) (f [])])
[{1 2, 3 4} [[1 2] [3 4]]]
(let [[a op b] (read-string "[1 + 1]")] (op a b))
1(let [a 0 b (inc a) c (inc b) d (inc b)] d)
2(let [x nil y nil coll []] (filter #(#{x y} %) coll))
()(let [c #{1 2 3} f (fn [] c)] (identical? (f) (f)))
true(let [v (atom [1 2 3])] (println v) (swap! v pop) (println v))
nil"#object[clojure.lang.Atom 0x58df638e {:status :ready, :val [1 2 3]}]\n#object[clojure.lang.Atom 0x58df638e {:status :ready, :val [1 2]}]\n"(let [I + Worship 1 His 2 Shadow 3] (I Worship His Shadow))
6(defmacro defspecialfn [& body] `(let [{:keys ~'[your keys here]} *the-global-map*] ~@body))
#'user/defspecialfn
(let [f #(< % 5) xs (range 15)] (partition-by f xs))
((0 1 2 3 4) (5 6 7 8 9 10 11 12 13 14))
(defn foo [m] (let [{major :major, minor :minor} m] (str major "." minor)))
#'user/foo
(let [[a b & rest] (iterate inc 0)] [a b (take 3 rest)])
[0 1 (2 3 4)]
(let [{a' :a, {:keys [a]} :b} {:a 0, :b {:a 1}}] [a a'])
[1 0]
(let [{:keys [c d], :or {c 0, d 0}} {:d 5}] [c d])
[0 5]
(let [m {:foo 7, :bar 8, :baz 7}] ((group-by m (keys m)) 7))
[:foo :baz]
(let [m {"foo" "FOO", "bar" "BAR"}] (zipmap (map keyword (keys m)) (vals m)))
{:bar "BAR", :foo "FOO"}
(let [coll [:a :b :c :d]] (->> coll (cycle) (rest) (take (count coll))))
(:b :c :d :a)
(let [filter-first (fn [pred s] (let [[a b] (split-with (comp not pred) s)] (concat a (rest b))))] (filter-first #(= 1 %) '(9 6 1 3 1)))
(9 6 3 1)
(let [fib-subseq [0 1 1 2 3 5]] (map vector fib-subseq (rest fib-subseq)))
([0 1] [1 1] [1 2] [2 3] [3 5])
(let [s "foo"] (condp #(.equals s %2) s "foo" "Win" :else "Lose"))
"Win"(defn pop-key [m k] (let [v (get m k)] [v (dissoc m k)]))
#'user/pop-key
(defmacro dump [expr] `(let [val# ~expr] (println '~expr (type val#) "->" val#)))
#'user/dump
(let [a 1 a (+ a 2) a (* a 5)] a)
15(let [f (fn [& {:keys [a]}] a)] ((partial f :a 1) :a 2))
2(let [adder (fn [x] (fn inner [y] (+ x y)))] (class (adder 1)))
sci.impl.fns$fun$arity_1__26688(let [a (atom {:a {:b 1}})] (swap! a update-in [:a :b] inc) @a)
{:a {:b 2}}
(let [m {:k1 "k2", :v3 "v4"}] (zipmap (map name (keys m)) (vals m)))
{"k1" "k2", "v3" "v4"}
(do (def a 1) (let [f (comp #'a)] (with-redefs [a (constantly 2)] (f))))
2(do (def a 1) (let [f (comp a)] (with-redefs [a (constantly 2)] f)))
1(defn seq1 [s] (lazy-seq (let [[x & xs] s] (cons s (seq1 xs)))))
#'user/seq1
(let [a '(1 2 3)] (for [x a y a] [x y]))
([1 1] [1 2] [1 3] [2 1] [2 2] [2 3] [3 1] [3 2] [3 3])
(let [m {:a 1, :b 2}] (list m (assoc m :c 3) m))
({:a 1, :b 2} {:a 1, :b 2, :c 3} {:a 1, :b 2})
(let [[a b] (split-at 2 [1 2 3 4])] (concat a (rest b)))
(1 2 4)
(let [n 10] (cond (zero? n) :zero (neg? n) :neg (pos? n) :pos))
:pos(let [m {:a 3, :b 2}] (for [[k n] m] (repeat n k)))
((:a :a :a) (:b :b))
(let [ss ["abc" "def"]] (String/format (apply str (repeat (count ss) "%s")) (to-array ss)))
"abcdef"

