function/macro | since v0.0-927 | clojure.core/+ | Edit |
(+)
(+ x)
(+ x y)
(+ x y & more)
Returns the sum of nums.
(+)
returns 0.
(+)
;;=> 0
(+ 1)
;;=> 1
(+ -10)
;;=> -10
(+ 1 2)
;;=> 3
(+ 1 2 3)
;;=> 6
Returns the sum of nums. (+) returns 0.
(defn ^number +
([] 0)
([x] x)
([x y] (cljs.core/+ x y))
([x y & more]
(reduce + (cljs.core/+ x y) more)))
(core/defmacro ^::ana/numeric +
([] 0)
([x] (core/list 'js* "(~{})" x))
([x y] (core/list 'js* "(~{} + ~{})" x y))
([x y & more] `(+ (+ ~x ~y) ~@more)))