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