function/macro | since v0.0-927 | clojure.core/max | Edit |
(max x)
(max x y)
(max x y & more)
Returns the greatest number argument.
Returns the greatest of the nums.
(defn ^number max
([x] x)
([x y] (cljs.core/max x y))
([x y & more]
(reduce max (cljs.core/max x y) more)))
(core/defmacro ^::ana/numeric max
([x] x)
([x y] `(let [x# ~x, y# ~y]
(~'js* "((~{} > ~{}) ? ~{} : ~{})" x# y# x# y#)))
([x y & more] `(max (max ~x ~y) ~@more)))