(let [f concat] (f '(1 2) '(3 4)))
(1 2 3 4)
(let [s "#_s"] (read-string (str "(\n" s "\n)")))
()(macroexpand-1 '(let [foo [1 2 3]] `(do ~@foo)))
(let [foo [1 2 3]] (clojure.core/sequence (clojure.core/seq (clojure.core/concat (clojure.core/list (quote do)) foo))))
(let [{:keys [a b]} {:a 1, :b 2}] [b a])
[2 1]
(let [x (transient [1 2 3])] (persistent! (conj! x 1)))
[1 2 3 1]
(let [ihaveamap {:foo nil, :bar nil}] (assoc ihaveamap :bar 100))
{:bar 100, :foo nil}
(let [[x & nums] [1 2 3 4]] [x nums])
[1 (2 3 4)]
(let [m {:a 1, :b 2}] (assoc m :a 3))
{:a 3, :b 2}
(let [{:keys [t1 t2]} {:x "hello", :y "goodbye"}] [t1 t2])
[nil nil]
(let [x [1 2]] `(= 3 ~(count x)))
(clojure.core/= 3 2)
(let [x "foo boo FOO Boo"] (re-seq #"(?i)f\w*" x))
("foo" "FOO")
(let [a 1] (condp = a 1 "Hey" 2 "Yo"))
"Hey"(let [[a b c] [1 2 3]] [b a c])
[2 1 3]
(let [a {:foo [10 20 30]}] (-> a :foo first))
10(let [a "s"] (case (class a) 'java.lang.String :found (class a)))
java.lang.String(let [t Object v 2] (with-meta {:value v} {:type t}))
{:value 2}
(let [a (range 1 12)] (format "%s" (apply list a)))
"(1 2 3 4 5 6 7 8 9 10 11)"(let [candidates [] n 42] (if (seq candidates) (first candidates) n))
42(let [[f & a] [* 5 3]] (apply f a))
15(let [{{baz :baz} :foo} {:foo {:bar "a", :baz "b"}}] baz)
"b"(let [x [[:c :d] [:e :f]]] `[[:a :b] ~@x])
[[:a :b] [:c :d] [:e :f]]
(let [foo []] (and (seq foo) (apply assoc {:a 42} foo)))
nil(defmacro mac [] `(let [x# [1 2 3]] (first x#)))
#'user/mac
(defn f [& ls] (let [[x & xs] ls] x))
#'user/f
(let [x (with-meta [1] {:a 1, :b 2})] (meta x))
{:a 1, :b 2}
(let [xs [1 2 3]] `(foo a ~xs b))
(user/foo user/a [1 2 3] user/b)
(let [[a & rest :as all] [1 2 3]] all)
[1 2 3]
(let [args '("foo" "bar")] `(blah ~(vec args)))
(user/blah ["foo" "bar"])
(let [s "k1=v1=k2=v2;"] (apply hash-map (clojure.string/split s #"[=;]")))
{"k1" "v1", "k2" "v2"}
(let [a 2] (condp = a 1 "Hey" 2 "Yo"))
"Yo"(let [[[a b] c] [[1 2] 3]] [a b c])
[1 2 3]
((fn my-fn [x] (let [y 10] (+ x y))) 10)
20(defmacro reffn [& body] `(let [my-fn# (ref (fn ~@body))]))
#'user/reffn
(let [a {} b {:hi 1}] (println a) (println a b))
nil"{}\n{} {:hi 1}\n"(macroexpand '(let [a 1] (-> 1 inc (* 2))))
(let [a 1] (-> 1 inc (* 2)))
(let [times-2 (partial * 2)] (map times-2 [1 2 3]))
(2 4 6)
(defn new-counter [] (let [a (atom 0)] (fn [] (swap! a inc))))
#'user/new-counter
(let [x 5] `(do ~x `(foo bar ~x)))
(do 5 (clojure.core/sequence (clojure.core/seq (clojure.core/concat (clojure.core/list (quote user/foo)) (clojure.core/list (quote user/bar)) (clojure.core/list user/x)))))
(let [a (range 1 12)] (format "Values: %s" (str a)))
"Values: (1 2 3 4 5 6 7 8 9 10 11)"(let [inf (* 2 Double/MAX_VALUE)] (> (* inf inf) inf))
false(let [digits (fn [n] (map int (str n)))] (digits 123))
(49 50 51)
(let [x [1 2 3]] [x (conj x 4) x])
[[1 2 3] [1 2 3 4] [1 2 3]]
(let [x (first {:a 2})] (identical? x (first (into {} [x]))))
false(let [[a b] (seq #{1 2 3 4})] b)
4(macroexpand-1 '(let [{:keys [b a], :or {b a}} m]))
(let [{:keys [b a], :or {b a}} m])
(let [x (range 5)] (if (rest x) x (first x)))
(0 1 2 3 4)
(let [[a & [b]] [1 2 3 4 5]] b)
2(let [{{:keys [first]} :name} {:name {:first "john", :last "smith"}}] first)
"john"(let [m 6 n 8] (repeatedly m #(rand-int n)))
(7 6 5 3 7 0)
(let [a 0 b (fn [] a) a 1] [a (b)])
[1 0]

