(let [[a b c] (iterate inc 1)] [a b c])
[1 2 3]
(let [a :x] (case :x :z 1 a 2 :default))
:default
(map (fn [[a b]] a) '([1 2] [3 4]))
(1 3)
(let [[a b] (seq #{"I wish" "this worked"})] a)
"this worked"
((fn [& [a b :as e]] [a b e]) 1)
[1 nil (1)]
(eval `(let [a '6 b '12] (+ a b)))
18
(reduce (fn [a b] (cons b a)) nil (range 10))
(9 8 7 6 5 4 3 2 1 0)
(let [[_ _ [_ a]] [1 2 [3 4]]] a)
4
(defn f [] (let [a 1 b 2] (println a b)))
#'user/f
(for [a [1 2] b [1 2]] [a b])
([1 1] [1 2] [2 1] [2 2])
(let [a 5 f #(+ % a)] (f 6))
11
(let [a #{1 2} a’ (conj a 3)] a’)
#{1 2 3}
(when-let [{:keys [a b c]} {:a 2}] [a b c])
[2 nil nil]
(macroexpand-1 '(let [x :foo {a x} {:foo 1}] a))
(let [x :foo {a x} {:foo 1}] a)
(sort '(just a little bit just a little bit))
(a a bit bit just just little little)
(let [a "s"] (case (class a) (class "s") :found :not-found))
:not-found
(binding [*read-eval* true] (read-string "#=(let [a 1] a)"))
1
(let [{:strs [a b]} {"a" 1, "b" 2}] [a b])
[1 2]
(for [[a b] (partition 2 (range 10))] [a (inc b)])
([0 2] [2 4] [4 6] [6 8] [8 10])
(let [foo (fn [a] (when a (recur nil)))] (foo true))
nil
(let [a :a b :a] (hash-map a 1 b 2))
{:a 2}
((fn [f a b] (f a b)) '+ 2 3)
3
(let [{a 0, b 1} [:A :B :C]] [a b])
[:A :B]
(let [[a & x] {:a 1, :b 1}] [a x])
[[:a 1] ([:b 1])]
(let [[a op b] [1 + 1]] (op a b))
2
(for [[k v] [[1 2]] :let [a (str k)]] a)
("1")
(defn f [{:keys [a b c]}] (+ a b c))
#'user/f
(defn func [f a & more] (map f a more))
#'user/func
(defn if-bad [a b c] (or (and a b) c))
#'user/if-bad
(let [a #(first %&)] (apply a (iterate inc 0)))
0
(merge-with (fn [a _] (inc a)) {:a 1} {:a 1})
{:a 2}
(letfn [(plus [a b] (+ a b))] (plus 1 2))
3
(loop [a 0] (loop [b 0] (print [a b]) (when (< b 3) (recur (inc b)))) (when (< a 3) (recur (inc a))))
nil
"[0 0][0 1][0 2][0 3][1 0][1 1][1 2][1 3][2 0][2 1][2 2][2 3][3 0][3 1][3 2][3 3]"
(let [a (atom [])] (clojure.walk/postwalk #(swap! a conj %) '(+ a (- b c))) @a)
[+ a - b c ([+ a -] [+ a - b] [+ a - b c]) ([+] [+ a] [+ a - b c ([+ a -] [+ a - b] [+ a - b c])])]
(-> [a b] (fn (assoc a b (-> b (a 0) inc))) (reduce {} "foo bar baz"))
{\space 2, \a 2, \b 2, \f 1, \o 2, \r 1, \z 1}
(for [a [1 2 3 4] b [1 2 3 4] :when (even? a)] [a b])
([2 1] [2 2] [2 3] [2 4] [4 1] [4 2] [4 3] [4 4])
(merge-with (fn [a b] (conj (if (vector? a) a [a]) b)) {:a 1, :b 2, :c 3} {:a 3, :b 5, :d 7})
{:a [1 3], :b [2 5], :c 3, :d 7}
(defn foo "does foo things to a and b" :a "tastes like apple" :b "looks like a bee" [a b] (+ a b))
#'user/foo
(first (reduce (fn [[acc pa] [a b c]] (let [a (if (empty? a) pa a)] [(conj acc [a b c]) a])) [] [["fresh" :hello :world] ["" :foo :bar] ["" :bar :baz] ["cool" :qux :qex] ["" :etc :etc]]))
(["cool" :etc :etc] ["cool" :qux :qex] ["fresh" :bar :baz] ["fresh" :foo :bar] ["fresh" :hello :world])
(def a (println "Really?"))
#'user/a
"Really?\n"
(def a (atom nil))
#'user/a
(let [a 1] 2)
2
(defprotocol A (m1 [this]))
{:methods #{#object [clojure.lang.MultiFn 0x1e4426a0 "clojure.lang.MultiFn@1e4426a0"]}, :name user/A, :ns #object [sci.impl.vars.SciNamespace 0x37a47b18 "user"], :sigs {:m1 {:arglists ([this]), :doc nil, :name m1}}}
(conj '(a) 'tag)
(tag a)
(conj {} '[a b])
{a b}
(def a (atom 0))
#'user/a
(defn a [x] x)
#'user/a
('#{a b} 'a)
a
(let [a 1] 1.0)
1.0
(defprotocol A (do-a [] ""))
{:methods #{#object [clojure.lang.MultiFn 0x222e43be "clojure.lang.MultiFn@222e43be"]}, :name user/A, :ns #object [sci.impl.vars.SciNamespace 0x37a47b18 "user"], :sigs {:do-a {:arglists ([]), :doc "", :name do-a}}}