function/macro | since v0.0-927 | clojure.core/- | Edit |
(- x)
(- x y)
(- x y & more)
If no y
s are supplied, returns the negation of x
, else subtracts the y
s
from x
and returns the result.
(- 1)
;;=> -1
(- 6 3)
;;=> 3
(- 10 3 2)
;;=> 5
If no ys are supplied, returns the negation of x, else subtracts the ys from x and returns the result.
(defn ^number -
([x] (cljs.core/- x))
([x y] (cljs.core/- x y))
([x y & more] (reduce - (cljs.core/- x y) more)))
(core/defmacro ^::ana/numeric -
([x] (core/list 'js* "(- ~{})" x))
([x y] (core/list 'js* "(~{} - ~{})" x y))
([x y & more] `(- (- ~x ~y) ~@more)))