(let [foo + bar 10] {:foo bar})
{:foo 10}
(let [x (Double. Double/NaN)] (= x x))
true
(let [[x & y] [1]] [x y])
[1 nil]
(= (let [x (-> [[1 2 3]] first first)] x) (let [[[x]] [[1 2 3]]] x))
true
(let [+# -] (+# 1 2 3))
-4
(let [[foo & [bar]] [1]] [foo bar])
[1 nil]
(let [form '(+ 1 1)] `~form)
(+ 1 1)
(let [a 1 b 2 c 3])
nil
(let [f +] (apply f [1 2]))
3
(let [x "some string"] (re-find #"a" x))
nil
(let [{a :foo} '(:foo :bar)] a)
:bar
(let [x (new Object)] (identical? x x))
true
(let [test 10 test 5] [test test])
[5 5]
(let [[a b] [1 2]] [a b])
[1 2]
(let [day :sunday] (get {:sunday "hello"} day))
"hello"
(let [existing-string "my-file.txt"] (str "prefix." existing-string ".postfix"))
"prefix.my-file.txt.postfix"
(let [a (partial + 2)] (a 2))
4
(let [] (def inc #(+ 1 %)))
#'user/inc
(let [[a b] "1"] (list b a))
(nil \1)
(let [ಠ_ರೃ #(println "Oh my.")] (ಠ_ರೃ))
nil
"Oh my.\n"
(let [[a & b] [1]] a b)
nil
(let [x 5] `(* ~x ~x))
(clojure.core/* 5 5)
(let [^Map x {:x 1}] (type x))
clojure.lang.PersistentArrayMap
(def z (let [d 3] (fn [] d)))
#'user/z
(let [a 5] `(a b c))
(user/a user/b user/c)
(let [l (doall (range 10))] (type l))
clojure.lang.LongRange
(->> (* i 2) (let [i 10]))
20
(let [^int x (rand-int 5)] (class x))
java.lang.Integer
(let [x 5] (first (lazy-seq (println x))))
nil
"5\n"
(let [k #"foo"] (get-in {k :bar} [k]))
:bar
(let [☃ "frosty"] (print-str ☃ "the" '☃))
"frosty the ☃"
(let [map map] (defn my-f [..] ..))
#'user/my-f
(let [foo "1.2.3"] (into [] (.split foo "2")))
["1." ".3"]
(let [f (partial + 1 1)] (f))
2
(let [my-var (atom 0)] (swap! my-var inc))
1
(let [this 10] (list '(this) [this]))
((this) [10])
(let [ctor #(String. %)] (ctor "fred"))
"fred"
(let [foo 5] (str (:name (meta #'foo))))
""
(let [x 1 a (inc x)] a)
2
(macroexpand '(let [a b] (c d)))
(let [a b] (c d))
(macroexpand '(let [{foo :asdf} (doit 100)]))
(let [{foo :asdf} (doit 100)])
(let [my-fun vector?] (str (:name (meta #'my-fun))))
""
(let [{foo' :foo, :keys [..]} map] ..)
nil
(let [kw :foo/bar] [(namespace kw) (name kw)])
["foo" "bar"]
(let [a 1 b 2] [a b])
[1 2]
(let [x "foo"] (identical? (str x) x))
true
(let [a 3] (println (+ 1 1)))
nil
"2\n"
(let [{:syms [time]} {'time "foo"}] [time time])
["foo" "foo"]
(let [a {} b {}] {a 1, b 2})
{{} 2}
(let [v ^:key (quote surname)] (meta v))
nil