((fn [{a :a}] a) nil)
nil
(let [a 3] (print a))
nil
"3"
(case '(a) ((a)) 1)
1
(def a (lazy-cat [1] a))
#'user/a
(let [{a 0} [:bar]] a)
:bar
(let [[a b] []] [a b])
[nil nil]
(do (def a 0) a)
0
(defn foo [a] {:a a})
#'user/foo
(let [a 3] #{a})
#{3}
(if-let [[a] (not-empty [])] a 'made-it)
made-it
(let [a 1 a 2] a)
1
(let [a \q] print a)
\q
(let [a "s"] (class a))
java.lang.String
(if-let [a (seq [])] a 'not-a)
not-a
(for [a (range 4)] [a])
([0] [1] [2] [3])
(defmacro macfoo [string & subs] `(-> ~string ~@(for [sub subs] `(foo ~sub))))
#'user/macfoo
(for [a [1 2 3]] (assoc {} a (- a)))
({1 -1} {2 -2} {3 -3})
(let [a {:a 1, :b 2}] (= a a))
true
(let [a {:a 0}] (assoc a :b 1) a)
{:a 0}
(let [a #()] (= a (with-meta a {:a 1})))
false
(let [i (memoize deref) a (atom 1)] (i a) (reset! a 2) (i a))
1
(defn rgcd [a b] (if (= a 0) b (rgcd [(rem b a) a])))
#'user/rgcd
(clojure.core/defn rgcd [a b] (if (= a 0) b (rgcd (rem b a) a)))
#'user/rgcd
(reduce (fn [a b] (if (>= a 10) (reduced a) (+ a b))) (range))
10
(let [a (fn [& {:keys [a b]}] [a b])] (a :a 1 :b 2))
[1 2]
(let [a 0 b (inc a) c (inc b)] (print a b c) (print a b) (print a))
nil
"0 1 20 10"
(defn ranger [a b] (if (< a b) (conj [a] (ranger (inc a) b)) []))
#'user/ranger
(let [a (fn [& {:keys [a b]}] [a b])] (a {:a 1, :b 2}))
[1 2]
(clojure.core/defn rgcd [a b] (if (= a 0) b (rgcd [(rem b a) a])))
#'user/rgcd
(((fn [a b] (fn [f] (f a b))) 1 2) (fn [a b] a))
1
((fn [& {:as a}] (apply (fn [& {:as a}] (println a)) a)) :a 1)
nil
"[:a 1]\n"
(for [a (range 7) b (range (inc a))] [a b])
([0 0] [1 0] [1 1] [2 0] [2 1] [2 2] [3 0] [3 1] [3 2] [3 3] [4 0] [4 1] [4 2] [4 3] [4 4] [5 0] [5 1] [5 2] [5 3] [5 4] [5 5] [6 0] [6 1] [6 2] [6 3] [6 4] [6 5] [6 6])
(let [a (promise)] (deliver a 10) (deliver a 20) @a)
10
(let [a 0 b (fn [] (println a)) a 1] (b))
nil
"0\n"
(defn prefix [a b] (= (take (count a) b) a))
#'user/prefix
(let [a 1 b (fn [] a)] (let [a 2] (b)))
1
(let [a {} b {:hi 1}] (println a) (println a b))
nil
"{}\n{} {:hi 1}\n"
(partition-by identity '(a b b c a a d))
((a) (b b) (c) (a a) (d))
(let [a "s"] (case (class a) 'java.lang.String :found (class a)))
java.lang.String
(defn not [g] (fn [a] (if (nil? (g a)) a)))
#'user/not
((fn ([a] a) ([a & more] (reverse more))) (range 10))
(0 1 2 3 4 5 6 7 8 9)
(with-local-vars [a 1 b 2] (var-set a 3) (var-get a))
3
(for [a (range 5) :let [x (* a a)]] x)
(0 1 4 9 16)
(let [a 1 b 2] [[a b] '[a b]])
[[1 2] [a b]]
(-> (fn [a] (+ a a)) ((fn [f] (f 1))))
2
((fn [& {a :a, :or {a 10}, :as kwargs}] a))
10
(let [a 1] (prn a) (let [a 2] (prn 2)))
nil
"1\n2\n"
(let [a '(fn [x] (println x))] ((eval a) a))
nil
"(fn [x] (println x))\n"
(defn a [f a & more] (map f a more))
#'user/a
(for [a (range 4) b (range a)] [a b])
([1 0] [2 0] [2 1] [3 0] [3 1] [3 2])