(seq " a ")
(\space \a \space)
('{a 1} 'a)
1
(macroexpand `{a b})
{user/a user/b}
(defrecord MyRec [a b])
#'user/MyRec
(defrecord R1 [a b])
#'user/R1
(vector? ''[a 1])
false
(let [a [:b :c]])
nil
(first '(a b))
a
(macroexpand '(and a))
(and a)
(defn comp*2 [a b] (comp (partial apply a) (partial map b)))
#'user/comp*2
(for [a [[1 2 3] [4 5]] b a] {:value b})
({:value 1} {:value 2} {:value 3} {:value 4} {:value 5})
(let [{a 0, b 3} [4 5 6 7]] [a b])
[4 7]
((fn [& {:strs [a b]}] [a b]) "a" 42 "b" 77)
[42 77]
(let [{a :a, :as m} [1 2 4]] (println a m))
nil
"nil [1 2 4]\n"
(let [{a :a, b :b} [:a 1 :b 2]] [a b])
[nil nil]
((fn [f a b] (f a b)) (read-string "+") 2 3)
3
(-> '(defn f [a b] (+ a b)) (nth 3))
(+ a b)
(let [[a b :as c] [1 2 3]] [a b c])
[1 2 [1 2 3]]
(let [[a b c] [1 2 3]] (println a b c))
nil
"1 2 3\n"
(let [a (atom {:foo []})] (swap! a update-in [:foo] conj :x) @a)
{:foo [:x]}
(let [{a :foo, b :bar} {:foo 5, :extra 6}] [a b])
[5 nil]
(let [[a b c] '(1 2 3)] [a b c])
[1 2 3]
(let [[a & [b c]] [1 2 3]] [a b c])
[1 2 3]
(into #{} '(a b a c d g g w))
#{a b c d g w}
(let [a {:a :b, :c :d}] (str (map reverse (into [] a))))
"clojure.lang.LazySeq@bc3043e0"
(let [val :the-val] (defn foo [a b] (str val a b)))
#'user/foo
(defn foo [a b] (/ (int (count a)) (int (count b))))
#'user/foo
(let [{a 0, b 1, :or {b 43}} [42]] [a b])
[42 43]
(let [[_ [_ [_ a]]] [1 [2 [3 [4 5]]]]] a)
[4 5]
(let [{:keys [a b]} {:a 1, :b 2}] (+ a b))
3
(reduce (fn [a b] (and a b)) '(true true false))
false
(->> {:a 1, :b 2} ((fn [{:keys [a b]}] [a b])))
[1 2]
(let [a (atom 1) b @a] (swap! a inc) [@a b])
[2 1]
(first (iterate (fn [[a b]] [b (+ a b)]) [0 1]))
[0 1]
(let [a (identity 25.0) b (identity (float 25.0))] (= a b))
true
(let [[f & a] (list * 5 3)] (apply f a))
15
(let [{:keys [a b]} {:a 1, :b 1}] (+ a b))
2
(for [{a :a, :as e} [{:a "c", :b "d"}]] [a e])
(["c" {:a "c", :b "d"}])
(let [{a "hello", b "world"} {"hello" 0, "world" 42}] [a b])
[0 42]
((fn [& {:keys [a b]}] [a b]) :a 1 :b 2)
[1 2]
((fn a [x] (if (zero? x) x (a (dec x)))) 1)
0
(merge-with into (for [[a b] [[:x 1] [:x 2]]] {a [b]}))
({:x [1]} {:x [2]})
(let [{:keys [a b], :or {:b 3}} {:a 1}] [a b])
[1 nil]
(let [name "test" a (atom {})] (swap! a assoc :name name) name)
"test"
(for [_ [1] :let [a [1 2 3]] b a] b)
(1 2 3)
(apply (fn [& a] (println "numbers: " a)) [1 2 3])
nil
"numbers: (1 2 3)\n"
(let [[& [a b c]] [1 2]] (list a b c))
(1 2 nil)
(let [a 1 b 2 c "hello"] '[a b c])
[a b c]
(let [{:syms [a b]} {'a 1, 'b 2}] (list a b))
(1 2)
(let [f (fn [& {a :a}] (inc a))] (f :a 10))
11