(eval '(for [i [1 2 3]] (inc i)))
(2 3 4)
(for [i (range 3)] [(dec i) i (inc i)])
([-1 0 1] [0 1 2] [1 2 3])
(->> (range 10) (map inc) (reduce +))
55
(defn go-up [n] (lazy-seq (cons n (go-up (inc n)))))
#'user/go-up
(= [2 3 4] (map inc [1 2 3]))
true
(apply (fn [& args] (first args)) (iterate inc 1))
1
(update-in {:session {:count 0}} [:session :count-2] (fnil inc 0))
{:session {:count 0, :count-2 1}}
(map inc (vals {:first 31, :second 63, :third 127}))
(32 64 128)
(map vector (iterate inc 0) '(foo bar baz))
([0 foo] [1 bar] [2 baz])
(update-in {:a {:x 2, :y 2}} [:a :x] inc)
{:a {:x 3, :y 2}}
(apply (fn [& x] (first x)) (iterate inc 0))
0
((fn [& rest] map inc rest) 1 2 3)
(1 2 3)
(map #(inc (second %)) {:a 1, :b 2})
(2 3)
(for [a (range 10) :when (odd? a)] (inc a))
(2 4 6 8 10)
(zipmap [:test1 :test2 :test3] (map inc [1 2 3]))
{:test1 2, :test2 3, :test3 4}
(first (remove {1 2, 3 4} (iterate inc 1)))
2
(binding [*read-eval* true] (read-string "#=(-> 1 inc)"))
2
(take 3 (apply concat (repeatedly #(iterate inc 0))))
(0 1 2)
(let [[h & t] (range 1 5)] (inc h))
2
((fn [& restfoo] map inc restfoo) 1 2 3)
(1 2 3)
(doseq [x (range 3)] (println "(inc bbloom)"))
nil
"(inc bbloom)\n(inc bbloom)\n(inc bbloom)\n"
(for [i (iterate inc 0) :while (even? i)] i)
(0)
(eval '(doseq [i [1 2 3]] (inc i)))
nil
(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])
(def triangles (concat [0] (map + triangles (iterate inc 1))))
#'user/triangles
(take-while #(< % 10) (filter even? (iterate inc 0)))
(0 2 4 6 8)
(mapv #(update-in % [0] inc) [[0 :a] [1 :b]])
[[1 :a] [2 :b]]
(def triangles (lazy-cat [0] (map + triangles (iterate inc 1))))
#'user/triangles
(reduce ((comp (map inc) (filter even?) (take 5)) conj) [] (range))
[2 4 6 8 10]
(->> 0 (iterate inc) (map int) (map type) (take 5))
(java.lang.Integer java.lang.Integer java.lang.Integer java.lang.Integer java.lang.Integer)
(let [m {:a 1}] (update-in m [:b] (fnil inc 0)))
{:a 1, :b 1}
(def triangles (cons 0 (map + triangles (iterate inc 1))))
#'user/triangles
(macroexpand '(pl (↕map range $ 3 λx (inc x))))
(pl (↕map range $ 3 λx (inc x)))
(update-in [{:pos {:x 0, :y 0}}] [0 :pos :x] inc)
[{:pos {:x 1, :y 0}}]
(def sum (lazy-cat [0] (map + sum (iterate inc 1))))
#'user/sum
(reduce * (reverse (take-while (partial > 10) (iterate inc 1))))
362880
(partition 2 (interleave (iterate inc 0) '(a b c)))
((0 a) (1 b) (2 c))
(let [coll [1 2 3]] (zipmap coll (map inc coll)))
{1 2, 2 3, 3 4}
(mapv (juxt first (comp inc second)) [["a" 0] ["b" 1]])
[["a" 1] ["b" 2]]
(let [foo [:a :b :c]] (zipmap foo (iterate inc 0)))
{:a 0, :b 1, :c 2}
(map trampoline (cycle [inc dec]) [1 2 3 4 5])
(2 1 4 3 6)
(repeatedly 10 #(let [a (atom 0)] (swap! a inc)))
(1 1 1 1 1 1 1 1 1 1)
(-> {:a [1 2 3 4]} :a (->> (map inc)))
(2 3 4 5)
(let [a 0 b (inc a) c (+ b b)])
nil
(take 5 (apply #(filter odd? %&) (iterate inc 0)))
(1 3 5 7 9)
(def abcs (map char (range (int \a) (inc (int \z)))))
#'user/abcs
(map list (iterate inc 0) [1 2 3 4 5])
((0 1) (1 2) (2 3) (3 4) (4 5))
(for [i (range 5) :let [j (inc i)]] [i j])
([0 1] [1 2] [2 3] [3 4] [4 5])
(let [f (with-meta #(inc %) {:awesome true})] (meta f))
{:awesome true}
(defn foo ([x] x) ([x y] (+ x (inc y))))
#'user/foo