(do (require ['clojure.walk :as 'walk]) (walk/macroexpand-all '(quote (let [a 1] a))))
(quote (let [a 1] a))
(let [m [1 4 2 7 8 5]] ((juxt min max) m))
[[1 4 2 7 8 5] [1 4 2 7 8 5]]
(let [awesome-list list*] (awesome-list 1 2 3 4 [5 6 7 8]))
(1 2 3 4 5 6 7 8)
(let [s [["a"] ["b"] ["a" "b"]]] (mapcat #(apply str %) s))
(\a \b \a \b)
(let [x nil l (lazy-seq (cons (println x) ())) x 5] (first l))
nil"nil\n"(let [x [1 2 3 4]] (map + x (drop 1 x)))
(3 5 7)
(let [{:keys [x y], :or {y 2}} {:x 3}] (+ x y))
5(let [coll [:a :b :c :d :e]] (map vector (reverse coll) coll))
([:e :a] [:d :b] [:c :c] [:b :d] [:a :e])
(let [{{g :a, h :b, :or {g 666, h 777}} :hhh} {}] [h])
[777]
(let [map->vec (fn [m] (mapv vec m))] (map->vec {:a 1, :b 2}))
[[:a 1] [:b 2]]
(let [dont-care (empty? (map (fn [_] (println "foo")) '(1 2)))] "constant")
"constant""foo\n"(let [args '(1 2 3 4)] (take (dec (count args)) args))
(1 2 3)
(let [f0 "C:\\long\\noext"] (second (re-find #"([^\\]*)\.[^.]*$" f0)))
nil(let [m {:a {:b 2, :c 3}}] (update-in m [:a] dissoc :c))
{:a {:b 2}}
(let [[x1 x2 x3 & xs :as tom] (range)] (take 5 tom))
(0 1 2 3 4)
(let [{a 1, b 2} (take 4 (iterate inc 1))] [a b])
[2 nil]
(let [[x y] (list (list 1 2) (list 3 4))] [x y])
[(1 2) (3 4)]
(let [x 0 x' (inc x) x'' (inc x')] (+ x'' x'))
3(let [*args* [1 2 3] [a1 a2 a3] *args*] [a1 a2 a3])
[1 2 3]
(let [start '(1 2 3)] (identical? start (pop (conj start 4))))
true(let [thing {:a 7} thing (assoc thing :b (dec (:a thing)))] thing)
{:a 7, :b 6}
(let [m {:foo [1]}] (assoc m :foo (conj (get m :foo) 2)))
{:foo [1 2]}
(let [{:keys [a b], :or {a 1}} {:b 1}] (+ a b))
2(let [[head & rest] (list [1 2 3])] {:head head, :rest rest})
{:head [1 2 3], :rest nil}
(let [{a :value, b :key, :or {a 10}} {:key "hello"}] [a b])
[10 "hello"]
(let [funcall (fn [f & args] (apply f args))] (funcall println 1))
nil"1\n"(let [yielder (fn [s] (let [a (atom s)] (fn [] (first (swap! a next))))) test (yielder (cycle [:conn1 :conn2 :conn3 :conn4]))] (for [_ (range 10)] (test)))
(:conn2 :conn3 :conn4 :conn1 :conn2 :conn3 :conn4 :conn1 :conn2 :conn3)
(let [foo false] `(whatever whatever ~@(when foo [`(actual code)])))
(user/whatever user/whatever)
(macroexpand '(add-params-to-func2 #(let [more "forms"] (+ %1 %2)) 3 4))
(add-params-to-func2 (fn* [%1 %2] (let [more "forms"] (+ %1 %2))) 3 4)
(let [s "foo bar"] (.substring s 0 (inc (.indexOf s " "))))
"foo "(let [s (list 1 2 3)] (identical? (conj (rest s) 1) s))
false(let [{ns :ns, n :name} (meta #'+)] (symbol (str ns) (name n)))
clojure.core/+(let [{foo :a, bar :b} '(:a 2 :b 3)] [foo bar])
[2 3]
(let [L (with-meta '(a b) {:foo :bar})] (meta (cons 'c L)))
nil(defn make-operator [x] (let [myx x] (fn [a b] (myx a b))))
#'user/make-operator
(let [x (list 2) y (conj x 1)] (identical? x (rest y)))
true(let [a (transient {})] (dotimes [x 16] (assoc! a x :ok)) (persistent! a))
{0 :ok, 1 :ok, 2 :ok, 3 :ok, 4 :ok, 5 :ok, 6 :ok, 7 :ok}
(let [a (atom {:a {}, :b {}})] (swap! a update-in [:b] assoc :data 10))
{:a {}, :b {:data 10}}
(let [f (fn [& rest] rest)] (f :wer 4 5 3 "ewr"))
(:wer 4 5 3 "ewr")
(eval `(let [~'foo 5] ~(read-string "(+ 10 foo)")))
15(let [c (first {:a 1})] [c (into (empty c) (map identity c))])
[[:a 1] (1 :a)]
(defn make-counter [init] (let [state (atom (dec init))] (fn [] (swap! state inc))))
#'user/make-counter
(let [s "a" s (str s "b") s (str s "c")] s)
"abc"(macroexpand '(let [{:or {a 1}, a :a, b :b} {:b 2}]))
(let [{a :a, b :b, :or {a 1}} {:b 2}])
(let [a 2 b 3] [(class a) (class b) (/ a b)])
[java.lang.Long java.lang.Long 2/3]
(defmacro abc [x] (let [m (symbol (str ".get" x))] `(~m (Object.))))
#'user/abc
(let [[a & b] '(1 2 3)] {:a a, :b b})
{:a 1, :b (2 3)}
(let [m ["the" "quick" "brown" "fox"]] (apply (juxt max-key min-key) count m))
["brown" "fox"]
(let [a (atom 1)] (prn @a) (reset! a 2) (prn @a) nil)
nil"1\n2\n"(let [x [1 2 3 4 5]] (nth x (rand-int (count x))))
2

