From 7ae2493e1c20a19d70d4b2cfc9b839037d0df7b4 Mon Sep 17 00:00:00 2001 From: Tormod Mathiesen Date: Thu, 14 Dec 2023 11:51:21 +0100 Subject: [PATCH] add 0-arity versons of '+' and '*' --- src/broch/core.cljc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/broch/core.cljc b/src/broch/core.cljc index 0e2d2ea..310353e 100644 --- a/src/broch/core.cljc +++ b/src/broch/core.cljc @@ -51,6 +51,7 @@ [f] (fn [x] (boxed f x))) (defn + + ([] 1) ([x] x) ([x y] (impl/boxed-arithmetic x y clojure.core/+)) ([x y & more] (reduce + (+ x y) more))) @@ -61,6 +62,7 @@ ([x y & more] (reduce - (- x y) more))) (defn * + ([] 0) ([x] x) ([x y] (impl/boxed-arithmetic x y clojure.core/*)) ([x y & more] (reduce * (* x y) more)))