(map #(% 0) [inc identity dec])
(1 0 -1)
(map (comp - inc) [1 2 3])
(-2 -3 -4)
(take 10 (filter even? (iterate inc 0)))
(0 2 4 6 8 10 12 14 16 18)
(take 1 (map print (iterate inc 0)))
(nil)
"0"
(reduce + (take 10 (iterate inc 1)))
55
(cond-> 3 true (* 2) false (inc))
6
(letfn [(x [a] (inc a))] (x 5))
6
(vec (map inc [1 2 3 4]))
[2 3 4 5]
(macroexpand '(let [x 12] (inc x)))
(let [x 12] (inc x))
(defn plus-one {:doc "..."} [x] (inc x))
#'user/plus-one
(reduce ((map inc) conj) () [1 2 3])
(4 3 2)
(def myseq (map constantly (iterate inc 0)))
#'user/myseq
(def make-id (partial swap! (atom 0) inc))
#'user/make-id
(def next-num (partial swap! (atom 0) inc))
#'user/next-num
((fn foo ([] (foo 1)) ([x] (inc x))))
2
(defn make-blue [person] (update-in person [:blood-alcohol] inc))
#'user/make-blue
(type (doall (map inc [1 2 3])))
clojure.lang.LazySeq
(and (seq (map inc '(4))) :wanted?)
:wanted?
(update-in {:a {:b 1}} [:a :b] inc)
{:a {:b 2}}
(->> (range 10) (map inc) (interpose 5))
(1 5 2 5 3 5 4 5 5 5 6 5 7 5 8 5 9 5 10)
(reduce (fn [[odd even] n] (if (odd? n) [(inc odd) even] [odd (inc even)])) [0 0] [1 2 7 9 8 5 1 0 1])
[6 3]
(update-in {:a {}} [:a :b] (fnil inc 0))
{:a {:b 1}}
(defn birthday [thing] (update-in thing [:age] inc))
#'user/birthday
(map #(inc %) [1 2 3])
(2 3 4)
(let [] (def inc #(+ 1 %)))
#'user/inc
(nth (map pr (iterate inc 1)) 2)
nil
"123"
(class (cons 2 (map inc [1 2])))
clojure.lang.Cons
(-> [1 2 3] (->> (map inc)))
(2 3 4)
(defn foo ([] (foo 32)) ([moose] (inc moose)))
#'user/foo
(/ 100 (-> 0 inc) 4 5)
5
(->> (range 10) (filter odd?) (map inc))
(2 4 6 8 10)
(->> 5 inc (range 1) (apply *))
120
(let [my-var (atom 0)] (swap! my-var inc))
1
(update {:wins 2, :losses 3} :losses inc)
{:losses 4, :wins 2}
(binding [*print-length* 10] (prn (iterate inc 1)))
nil
"(1 2 3 4 5 6 7 8 9 10 ...)\n"
(update {:a 0, :b 1} :b inc)
{:a 0, :b 2}
(str (map (comp char inc int) "hi123"))
"clojure.lang.LazySeq@7ad6df1"
(let [x 1 a (inc x)] a)
2
(set (map inc #{1 2 3}))
#{2 3 4}
(update-in {:foo {:bar 1}} [:foo :bar] inc)
{:foo {:bar 2}}
(->> (inc x) (for [x (range 10)]))
(1 2 3 4 5 6 7 8 9 10)
(cond-> 3 true (* 2) true (inc))
7
(update-in {:a 10, :b 20} [:a] inc)
{:a 11, :b 20}
(defn finc [f x] (f (inc x)))
#'user/finc
(let [x 1 x´ (inc x)] x´)
2
(apply vector (map inc [1 2 3]))
[2 3 4]
(def go-up (lazy-cat [1] (inc (last go-up))))
#'user/go-up
(zipmap [:foo :bar :baz] (iterate inc 0))
{:bar 1, :baz 2, :foo 0}
(->> (update-in (vec (->> 11 (* (inc 11)) (iterate dec) (take 11) (reverse) (take 1) (first) (range 111) (take (inc 1)) (map char) (reverse) (partition (inc 1) 1) (cycle) (take (inc 1)))) [1] reverse) (flatten) (apply str))
"poop"
(update [12 13 14 15] 3 inc)
[12 13 14 16]