(let [a {} a (assoc a :b 1)] a)
{:b 1}
(->> (+ a 5) (- 20) (let [a 9]))
6(let [n (do (println "hello") nil)] (and false n))
false"hello\n"(defn foo [x] (let [f #(+ x %)] (if (even? x) (let [g #(dec %)] (g x)) (f 10))))
#'user/foo
(let [more (atom true)] (take-while #(let [end? (< % 30) ret @more] (reset! more end?) ret) [10 20 30 40]))
(10 20 30)
(let [mymap {:a 1, :b 2, :c 3, :d 4}] (let [{:keys [a b c d]} mymap] [a b c d]))
[1 2 3 4]
(let [m (transient (hash-map))] (dotimes [n 10000] (assoc! m n (inc n))) (let [m' (persistent! m)] [(count m') (get m' 4567)]))
[8 nil]
(let [[a b & rest] (range 10)] [a b rest])
[0 1 (2 3 4 5 6 7 8 9)]
(let [[a & b] (iterate inc 0)] (take 5 b))
(1 2 3 4 5)
(let [f (comp symbol name)] (-> {:name "foo"} :name f))
foo(let [s (set (apply hash-map (range 10)))] [s (keys s)])
[#{[0 1] [2 3] [4 5] [6 7] [8 9]} (8 2 6 4 0)]
(defn box [value] (let [p (promise)] (deliver p value) p))
#'user/box
(let [#^{ :a 1 :b 2} x [1]] (meta 'x))
nil(let [x 1/6] (+ x x x x x x))
1N
(defmacro foobar [& bodies] `(let [~'foo #(something)] ~@bodies))
#'user/foobar
(let [[x y] (seq [1 2 3 4])] [x y])
[1 2]
(let [{i :foo} :ivec {:foo {:bar 1, :baz 2}}] i)
nil(let [◔ (fn [& _]) ◡ 1] (◔ ◡ ◔))
nil(let [f (juxt key val)] (-> {1 2} first f))
[1 2]
(let [{x :a, & rest} {:a 1, :b 2}] x)
1(macroexpand-1 '(let [[a b] [1 2]] (+ a b)))
(let [[a b] [1 2]] (+ a b))
(let [a (identity 25.0) b (identity 25.0)] (= a b))
true(let [c "c"] (re-pattern (str "ab(" c ")")))
#"ab(c)"
(let [#^{ :a 1 :b 2} x [1]] (meta x))
nil(defn -main [& args] (let [n (nth args 2)] n))
#'user/-main
(let [[head & tail] [1 2 3 4]] [head tail])
[1 (2 3 4)]
(let [input "1"] (condp = input "0" "1" "1" "0"))
"0"(let [{:syms [a b]} {'a 1, 'b 2}] [a b])
[1 2]
(let [x (atom 1)] (swap! x + 2) (println @x))
nil"3\n"(defmacro z [dict] (let [s (:param dict)] `(ns ~s)))
#'user/z
(let [x 1] (meta ^{:foo x} [1 x 3]))
{:foo 1}
(let [x (with-meta [] {:foo 3})] (identical? x (with-meta x nil)))
false(let [{odds true, evens false} (group-by odd? (range 10))] evens)
[0 2 4 6 8]
(let [x '(1 2 3)] `[~x (list ~@x)])
[(1 2 3) (clojure.core/list 1 2 3)]
(let [p (rand-int 2) np (rand-int 2)] (= p np))
true(let [s "بينظير ڀٽو"] (= s (.toLowerCase s) (.toUpperCase s)))
true(let [x (with-meta 'foo {:lineno 10, :column 8})] (meta x))
{:column 8, :lineno 10}
(let [[f & r] (sorted-set 1 3 2)] [f r])
[1 (2 3)]
(defn make-counter [] (let [x (atom 0)] (fn [] (swap! x inc))))
#'user/make-counter
(let [fs [(constantly nil) (constantly true)]] (some #(%) fs))
true(let [[a b c] (iterate inc 1)] [a b c])
[1 2 3]
(let [f (fn [] (fn [y] (inc y)))] (identical? (f) (f)))
false(let [a :x] (case :x :z 1 a 2 :default))
:default(let [writer (java.io.StringWriter.)] (binding [*out* writer] (println "foo") (str writer)))
"foo\n"(let [s "foo"] (condp = s "foo" "Win" :else "Lose"))
"Win"(let [int-c (fn [x] (- (int x) 48))] (int-c \0))
0(let [str "Blah blah"] (.substring str 0 (dec (count str))))
"Blah bla"(let [n [1 2 3] n (map inc n)] n)
(2 3 4)
(let [[x y z] (range 10000)] (+ x y z))
3(let [[x & xs] [1 2 3]] (cons x xs))
(1 2 3)

