Content-Length: 210603 | pFad | http://github.com/anteoas/broch/commit/7ae2493e1c20a19d70d4b2cfc9b839037d0df7b4

5A add 0-arity versons of '+' and '*' · anteoas/broch@7ae2493 · GitHub
Skip to content

Commit

Permalink
add 0-arity versons of '+' and '*'
Browse files Browse the repository at this point in the history
  • Loading branch information
2food committed Dec 14, 2023
1 parent 293a36c commit 7ae2493
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/broch/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand All @@ -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)))
Expand Down

0 comments on commit 7ae2493

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/anteoas/broch/commit/7ae2493e1c20a19d70d4b2cfc9b839037d0df7b4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy