1 (def! inc (fn* (a) (+ a 1)))
3 (def! dec (fn* (a) (- a 1)))
5 (def! zero? (fn* (n) (= 0 n)))
10 (reduce f (f init (first xs)) (rest xs))
13 (def! identity (fn* (x) x))
19 (every? pred (rest xs))
23 (def! not (fn* (x) (if x false true)))
28 (let* (res (pred (first xs)))
31 (some pred (rest xs))))
40 `(let* (and_FIXME ~(first xs))
41 (if and_FIXME (and ~@(rest xs)) and_FIXME))))))
49 `(let* (or_FIXME ~(first xs))
50 (if or_FIXME or_FIXME (or ~@(rest xs))))))))
54 (if (> (count clauses) 0)
55 (list 'if (first clauses)
56 (if (> (count clauses) 1)
58 (throw "cond requires an even number of forms"))
59 (cons 'cond (rest (rest clauses)))))))
65 (let* (form (first xs)
69 `(~(first form) ~x ~@(rest form))
71 `(-> (-> ~x ~form) ~@more))))))
77 (let* (form (first xs)
81 `(~(first form) ~@(rest form) ~x)
83 `(->> (->> ~x ~form) ~@more))))))