(meta (second '(a #^b c)))
{:tag b}
(concat '(a b) '(c))
(a b c)
(let [id 1] '(a id))
(a id)
(def a (lazy-seq (cons (println "foo") ())))
#'user/a
(str "[a b c]")
"[a b c]"
(def a #(/ %1 %2))
#'user/a
(def a (map (partial * 2)))
#'user/a
(macroexpand '(-> a b c))
(c (b a))
(apply concat '((a) (b) (c)))
(a b c)
(symbol "string which isn't a symbol")
string
(first (rest '(a b c)))
b
(defprotocol Foo (bar [a & rest]))
{:methods #{#object [clojure.lang.MultiFn 0x385080e9 "clojure.lang.MultiFn@385080e9"]}, :name user/Foo, :ns #object [sci.impl.vars.SciNamespace 0x37a47b18 "user"], :sigs {:bar {:arglists ([a & rest]), :doc nil, :name bar}}}
(def a {:abc-one 1, :abc-two 2})
#'user/a
(drop 1 (reductions (fn [_ a] (a)) nil (map #(partial % 'a->b) [class identity])))
(clojure.lang.Symbol a->b)
(map #(apply (fn [a b] (str a "/" b)) %) [["" 2] [3 4]])
("/2" "3/4")
(apply (fn [& {:keys [a b]}] (+ a b)) (apply concat {:a 1, :b 2}))
3
(for [b '(b1 b2 b3)] (vec (for [a '(a1 a2)] (list b a))))
([(b1 a1) (b1 a2)] [(b2 a1) (b2 a2)] [(b3 a1) (b3 a2)])
((fn f [a & [{:keys [b], :or {b 42}}]] (+ a b)) 1 :b 20)
43
(map first (reductions (fn [[a b] _] [b (+ a b)]) [1 1] (range 5)))
(1 1 2 3 5 8)
(let [{a 0, b 5} [:a :b :c :d :e :f :g :h]] [a b])
[:a :f]
((fn f [a & [{:keys [b], :or {b 42}}]] (+ a b)) 1 {:b 20})
21
(let [a (atom [1 2 3])] (swap! a (partial filterv (fn [x] (not= x 2)))))
[1 3]
(map (fn [[a b]] (str a " - " b)) '([1 2] [3 4]))
("1 - 2" "3 - 4")
(let [a (atom false) l (lazy-seq (swap! a not) nil)] [(first (cons 3 l)) @a])
[3 false]
(map (fn [[a b]] [a (+ b 4)]) '([1 1] [1 3] [3 2]))
([1 5] [1 7] [3 6])
(let [{:keys [a b], :as all} {:a 12, :b 34, :c 56}] [a b all])
[12 34 {:a 12, :b 34, :c 56}]
(-> (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1])) (nth 40))
102334155
(defn range-incl [a b] (apply range (map + ((juxt min max) a b) [0 1])))
#'user/range-incl
(let [a (atom false) l (lazy-seq (swap! a not) nil)] [(first (conj l 3)) @a])
[3 true]
(let [xs (range 10)] (mapcat (fn [[a b]] [(/ a 2) b]) (partition 2 xs)))
(0 1 1 3 2 5 3 7 4 9)
(let [[x y && {:keys [a b]}] [1 2 :a 3 :b 4]] [a b])
[nil nil]
((fn f [a & [{:keys [b], :or {b 42}}]] (+ a b)) 1 {:b 12})
13
(let [f (fn [& [a b c]] (println a b c))] (f 4 6 8))
nil
"4 6 8\n"
(nth ((fn [] (map first (iterate (fn [[a b]] [b (+ a b)]) [0N 1N])))) 250)
7896325826131730509282738943634332893686268675876375N
(def a (with-meta 'a {:test #(if (< a 10) (throw (Exception. "Value under 10!")))}))
#'user/a
(def foo (let [lalala 1] (fn foo [a b c] (println a b c lalala))))
#'user/foo
(let [foo (fn [& [a b :as all]] [a b all])] (foo 1 2 3))
[1 2 (1 2 3)]
(defn cycler [coll] (let [a (atom (cons nil (cycle coll)))] #(first (swap! a rest))))
#'user/cycler
(let [{:strs [a b c]} {"a" 1, "b" 2, "c" 3}] (+ a b c))
6
(->> [0 1] (iterate (fn [[a b]] [b (+ a b)])) (map first) (take 10))
(0 1 1 2 3 5 8 13 21 34)
(let [{:keys [a b], :as m} {:a 1, :b 2, :c 3}] [a b m])
[1 2 {:a 1, :b 2, :c 3}]
(defn daset [a vals] (doseq [[i j] (partition 2 vals)] (aset #^doubles a i j)))
#'user/daset
(loop [a 1 b 2] (when (< b 5) (print b) (recur b (inc a))))
nil
"223344"
((fn [a b & {c :age}] [a b c]) 1 2 :name "steve" :age "paul")
[1 2 "paul"]
(let [[x y] '(5 6)] ((fn [z a] (+ z a 1)) x y))
12
(every? (fn [[a b]] (= 1 (- b a))) (partition 2 1 [1 2 3]))
true
(seq (reduce (fn [m [a b]] (if (contains? m a) m (assoc m a b))) (sorted-map) [[1 2] [1 3] [2 4] [2 6]]))
([1 2] [2 4])
((fn drop1 [[x & y]] (if (= x 'a) y (lazy-seq (cons x (drop1 y))))) '[c b a a b c a b])
(c b a b c a b)
(with-local-vars [a 0 b 1] (dotimes [_ 10] (var-set a (+ @a @b)) (var-set b (+ @a @b))) (mapv (juxt identity deref) [a b]))
[[#'G__1243627 6765] [#'G__1243628 10946]]
((fn two-parts ([coll] (two-parts coll [] [])) ([coll a b] (if (empty? coll) [a b] (recur (rest coll) (conj b (first coll)) a)))) (range 10))
[[1 3 5 7 9] [0 2 4 6 8]]