(let [[x y] [1 2]] (clojure.core/+ x y))
3(let (x 3 y 4) (+ x y))
7(let [f (fn [] (binding [*print-length* 100] *print-length*))] (f))
100(let [x :a] [(class x) (x {:a :b})])
[clojure.lang.Keyword :b]
(let [do concat] (do [1 2] [3 4]))
[3 4]
(let [n (- 2 5)] (- 10 n))
13(let [x (reify clojure.lang.IDeref (deref [this] "lol"))] @x)
"lol"(let [{:keys [a b]} {"a" 1}] (println a))
nil"nil\n"(let [x '(42)] (identical? x (seq x)))
true(let [x '[42]] (identical? x (seq x)))
false(let [a (range 3)] `(:foo ~@a :bar))
(:foo 0 1 2 :bar)
(let [{{n :n} :m} {:m {:n 42}}] n)
42(let [x 10 y 20] '[x y])
[x y]
(let [{name :first} {:last 'smith, :first 'david}] name)
david(let [[_ {:keys [key]}] [:keyword {:key "value"}]] key)
"value"(let [x (atom 5)] (swap! x inc) @x)
6(let [a (fn [_] (println "hello"))] (a "ok"))
nil"hello\n"(let [{a :a, :or {a "nope"}} 1] a)
"nope"(let [x 2 x (+ x 3)] x)
5(let [it's-looking-good true] (when it's-looking-good (println "happy day")))
nil"happy day\n"(let [x [1 2]] (= x [1 2]))
true(defmacro testing-123 [] `(let [y 1] (print y)))
#'user/testing-123
(let [lst '(1 2 3)] '(lst))
(lst)
(let [a 5 b 6] (+ a b))
11(let [x 12] (+ x (* x x)))
156(let [v [\u2620]] (= (read-string (pr-str v)) v))
true((let [a 2 b 3] (fn [] [a b])))
[2 3]
(let [ys [1]] (identical? (seq (lazy-seq ys)) ys))
false(let [a nil b 43] (or a b))
43(let [my-name "Konstantinos"] (println (str "hello " my-name)))
nil"hello Konstantinos\n"(let [foo (gensym)] `(fn [~foo] (inc ~foo)))
(clojure.core/fn [G__3036902] (clojure.core/inc G__3036902))
(let [d (delay nil)] (if @d true false))
false(let [x 13] (- x (rem x 3)))
12(let [x [3 2 1]] (sort x) x)
[3 2 1]
(let [[k v] [:this :that]] (list k v))
(:this :that)
(defmacro testing-123 [] `(let [y# 1] (print y#)))
#'user/testing-123
(let [x 3 y 10] (- y x))
7(macroexpand '(let [x 1 y 2] x))
(let [x 1 y 2] x)
(let [{{c :a} :b} {:b {:a 1}}] c)
1(let [a 42] (fn [a*] (a*)) (var a))
42(do (print cons) (let [cons 1] (print cons)))
nil"#object[clojure.core$cons__5441 0xea33fcb clojure.core$cons__5441@ea33fcb]1"(let [f (fn anonymous [] anonymous)] (= f (f)))
true(defmacro and-let [bindings then else] (let [tests (take-nth 2 (rest bindings))] `(if (and ~@tests) (let ~bindings ~then) ~else)))
#'user/and-let
(let [k :a] (let [[a b c] (k {:a ['foo 'bar 'baz], :b [2 3 4]})] [a b c]))
[foo bar baz]
(let [a {:x 10, :y {:z 20}}] (let [{x :x, y :y, {z :z} :y} a] [x y z]))
[10 {:z 20} 20]
(defmacro and-let [bindings & body] (let [names (map first (partition 2 bindings))] `(let ~bindings (when (and ~@names) ~@body))))
#'user/and-let
(let [input ^{:foo :bar} {:a 1}] (let [{a :a} input {foo :foo} (meta input)] (str foo \: a)))
":bar:1"(let [[f o o] "foo"] (str o o f))
"oof"(let [x (concat '(println) '(1))] (doall x))
(println 1)
(let [x 2] (cond-> 5 (even? x) (+ 1)))
6

