(read-string "(or a b)")
(or a b)
(printf "Please make a selection: ")
nil
"Please make a selection: "
(let [a 12] `[y ~a])
[user/y 12]
(macroexpand '(->> a b c))
(c (b a))
(.trim " a bc \n ")
"a bc"
((quote #{y x}) (quote a))
nil
(str '(a b c d))
"(a b c d)"
(if-let [a 5] 1 (throw (Exception.)))
1
(macroexpand '(-> 1 '(a)))
(quote 1 (a))
(defn test1 [a b] "hello world")
#'user/test1
(macroexpand-1 '(->> x (a b)))
(a b x)
(-> (a b c) quote reverse)
(c b a)
(macroexpand-1 '(pl a � b))
(pl a � b)
(defrecord Baz [a b c d])
#'user/Baz
(defmacro foo [a b] (keys &env))
#'user/foo
(defmacro foo [a] `(last ~a))
#'user/foo
(do (def a inc) (namespace `a))
"user"
(flatten '[a [b [c d]]])
(a b c d)
(macroexpand '(if-not a b c))
(if (clojure.core/not a) b c)
(let [a 1] (macroexpand '(test1)))
(test1)
(def a ^{:created (System/currentTimeMillis)} '1)
#'user/a
(defmacro make-let [a b & cs] `(let [~@(mapcat vector a b)] ~@cs))
#'user/make-let
(defn foo [a #_"This will be ignored" b #_"so will this"] (+ a b))
#'user/foo
((fn a [n] (when (not (zero? n)) (lazy-seq (cons n (a (dec n)))))) 10)
(10 9 8 7 6 5 4 3 2 1)
(mapcat (fn [a b] [(inc a) (inc b)]) [1 2 3] [4 5 6])
(2 5 3 6 4 7)
(let [x (fn [a] (inc a)) y inc z inc] (x (y (z 1))))
4
(let [{:keys [a b & c]} {:a 1, :b 2}] [a b & c])
[1 2 nil nil]
(let [a ['a 'b] b [1 2 3]] (cons (first b) (interleave a b)))
(1 a 1 b 2)
(let [f (fn [{:keys [a]}] a)] (#(f (merge {:a 1} %)) {:a 2}))
2
(let [{:keys [a b c]} {:a 1, :b 2, :c 3}] [a b c])
[1 2 3]
(let [lst (range 10) [a b] (take-last 2 lst)] {:a a, :b b})
{:a 8, :b 9}
(map second (take 15 (iterate (fn [[a b]] [b (+ a b)]) [1 0])))
(0 1 1 2 3 5 8 13 21 34 55 89 144 233 377)
(let [[a b] (split-with (partial not= 5) (range 0 50))] (concat a (rest b)))
(0 1 2 3 4 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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49)
((fn [{:keys [a b], :as c, :or {:a 1, :b 2}}] [a b c]) {})
[nil nil {}]
(let [map {:a 1, :b 2}] (let [{a :a, b :b} map] [a b]))
[1 2]
(let [[a b] (split-with (partial not= 3) (range 0 5))] (concat a (rest b)))
(0 1 2 4)
(let [a (atom {:a {:b 1}})] (swap! a update-in [:a :b] + 2) @a)
{:a {:b 3}}
(reduce (fn [a [k & v]] (assoc a k v)) {} [[:a "hey"] [:b "yo"]])
{:a ("hey"), :b ("yo")}
(let [[a b] (re-matches #"(\d+) (\d+)" "12 34")] (prn a) (prn 2))
nil
"\"12 34\"\n2\n"
(let [n 3 a [1 2] b [11 22 33 44 55]] (take n (let [ca (count a)] (concat a (drop ca b)))))
(1 2 33)
(defn match-prefix [s] (condp (fn [b a] (= (subs a 0 (min (count b) (count a))) b)) s "def" :a "ABC" :b :c))
#'user/match-prefix
(let [a {1 1, 2 2, 3 3, 4 4, 5 5, 6 6, 7 7}] [(class (conj a [8 8])) (class a)])
[clojure.lang.PersistentArrayMap clojure.lang.PersistentArrayMap]
(defn fibo [x n a b] ((if (> x n) () (cons (+ a b) (fibo (+ x 1) n b (+ a b))))))
#'user/fibo
(let [a ['a 'b] b [1 2 3]] (cons (first b) (interleave a (rest b))))
(1 a 2 b 3)
((fn [a b c] (concat a [b] c)) [0 0 0] 1 [2 2 2])
(0 0 0 1 2 2 2)
(let [a (atom nil)] (reset! a (lazy-seq (cons 1 (map inc @a)))) (take 4 @a))
(1 2 3 4)
(let [{:keys [a b c]} {:a 0, :b 1, :c 2}] (+ a b c))
3
((fn [& {:keys [a b c]}] [a b c]) :a 1 :b 2 :c 3)
[1 2 3]
(let [{a :argh, :keys [b c]} {:argh 1, :b 2, :c 3}] [a b c])
[1 2 3]
(defn fibo [] 153 (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1])))
#'user/fibo