(let [pairs (partition 2 (range 6))] [(map first pairs) (map second pairs)])
[(0 2 4) (1 3 5)]
(let [[x & args] [1 2 3 4]] {:x x, :args args})
{:args (2 3 4), :x 1}
(let [! meta] ((! '(+)) ((`[~@(-> '(?) !)] (+)) (+))))
1(let [t (transient {})] (dotimes [i 100] (assoc! t i i)) (persistent! t))
{0 0, 1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7}
(let [x '(1 2 3)] [(cons 0 x) (conj x 0)])
[(0 1 2 3) (0 1 2 3)]
(let [s "foo"] (condp #(.equals s %2) "foo" "Win" :else "Lose"))
:else(let [a '(fn [x] x) b (fn [x] x)] [a b])
[(fn [x] x) #object [sci.impl.fns$fun$arity_1__26688 0x719c39ae "sci.impl.fns$fun$arity_1__26688@719c39ae"]]
(let [a (atom {:x #{1}})] (swap! a update-in [:x] conj 2))
{:x #{1 2}}
(let [sorted (sort < [1 2 3])] (= sorted [1 2 3]))
true(let [a (hash-map Double/NaN 1)] (= (key (first a)) (key (first a))))
true(let [in [{:check ["foo"]} {:check ["bar"]}]] (apply merge-with (partial apply conj) in))
{:check ["foo" "bar"]}
(defmacro add-and-print [& args] (let [func (cons `+ args)] `(print ~func)))
#'user/add-and-print
(defmacro nils [n] (let [x# (repeat (eval n) nil)] `(print ~@x#)))
#'user/nils
(let [[a & more] [1] [b & rest] []] [more rest a b])
[nil nil 1 nil]
(let [s (seq '(1 2 3))] (identical? (rest s) (rest s)))
true(let [{odd false, even true} (group-by odd? (range 5))] (println odd even))
nil"[0 2 4] [1 3]\n"(let [player (atom {:health 100, :name "Frank"})] (swap! player update-in [:health] dec))
{:health 99, :name "Frank"}
(let [t (transient {})] (dotimes [i 10] (assoc! t i i)) (count t))
8(let [big Double/MAX_VALUE] (= (* 0.5 2 big) (* big 2 0.5)))
false(let [a {:a 1, :b 2} b (dissoc a :a)] [a b])
[{:a 1, :b 2} {:b 2}]
(let [a 1] (map #(+ a %) [1 2 3 4]))
(2 3 4 5)
(let [a '((println 10 20) (println 40 50))] `(do ~@a))
(do (println 10 20) (println 40 50))
(let [s (map #(print % " ") (range 40))] (first s))
nil"0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 "(let [v [1 2 3 4]] (conj (pop v) (inc (peek v))))
[1 2 3 5]
(let [foo "hello" bar "world"] `(~(symbol (str foo "/" bar))))
(hello/world)
(let [] (println (+ 1 2)) (println (+ 10 20)) (+ 100 200))
300"3\n30\n"(let [{x :a, y :b} {:a 1, :b 2}] (list x y))
(1 2)
(let [a (to-array [1 "foo" (Object.)])] (aset a 1 "bar") (seq a))
(1 "bar" #object [java.lang.Object 0xa4430a3 "java.lang.Object@a4430a3"])
(let [{{{{:keys [blum]} :bloom} :blerg} :blah} {:blah {:blerg {:bloom {:blum 'abc}}}}] blum)
abc(let [name "Michael" my-data {name (atom 22)}] (swap! (my-data name) inc) my-data)
{"Michael" #object [clojure.lang.Atom 0x26ce071f {:status :ready, :val 23}]}
(let [xs [['a 'b] ['a] ['a]]] (->> xs (map set) (reduce clojure.set/intersection)))
#{a}
(doseq [i (range 10)] (let [j (+ i 10)] (println i j)))
nil"0 10\n1 11\n2 12\n3 13\n4 14\n5 15\n6 16\n7 17\n8 18\n9 19\n"(let [{:keys [a b & c]} {:a 1, :b 2}] [a b])
[1 2]
(defmacro m [y & b] `(let [~'x (conj ~'x ~y)] ~@b))
#'user/m
(let [{a 0, b 1, :or {b 43}} (seq [42])] [a b])
[nil 43]
(let [nan (Double/NaN)] [(> 5 nan) (= 5 nan) (< 5 nan)])
[false false false]
(let [[n [d]] '(a (b c d))] {:n n, :d d})
{:d b, :n a}
(defn foo [] (let [inc #(+ 3 %1)] (map inc (range 3))))
#'user/foo
(let [numstring "1,2,3"] (apply + (map #(Double/parseDouble %) (clojure.string/split numstring #","))))
6.0(let [f (juxt first second last)] (f [1 2 3 4 5]))
[1 2 5]
(type (let [[h & t] '(1 2 3 4 5)] t))
clojure.lang.PersistentList(let [vec [2 3 4 5]] (conj (pop vec) (inc (peek vec))))
[2 3 4 6]
(let [v [1 2 3 4 5]] (v (- (count v) 2)))
4(let [f-maker (fn [] #(apply + %&))] (= (class (f-maker)) (class (f-maker))))
true(= (let [lines [[3 2 3] [5 7 1]]] (map list lines (range (count lines)))) (let [lines [[3 2 3] [5 7 1]]] (map list lines (range))))
true(let [yield (fn [seq] (let [a (atom (cons nil seq))] (fn [] (first (swap! a next))))) test (yield (cycle [:conn1 :conn2 :conn3 :conn4]))] (dotimes [_ 10] (test)))
nil(let [x 1] `(xxx (yyy (bbb (zzz ~x) ~x) ~x ~x ~x)))
(user/xxx (user/yyy (user/bbb (user/zzz 1) 1) 1 1 1))
(count @(let [queue (atom [])] (dotimes [n 3000] (swap! queue conj n)) queue))
3000(let [m {:thinga [{:a1 "x", :a2 "y"}]} {[{a :a1}] :thinga} m] a)
"x"(let [{:keys [:user :password :role], :or {:role :anon}} {:user :john, :password :doe}] role)
nil

