You're viewing version 1.2.0 of -. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16
  • (- x)
  • (- x y)
  • (- x y & more)
If no ys are supplied, returns the negation of x, else subtracts
the ys from x and returns the result.

1 Example top

  • user=> (- 1)
    -1 
    user=> (- 6 3)  
    3
    user=> (- 10 3 2)  
    5
Log in to add / edit an example.

See Also top

  • 0
    clojure.core/-'

    If no ys are supplied, returns the negation of x, else subtracts the y

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:842 top

(defn -
  "If no ys are supplied, returns the negation of x, else subtracts
  the ys from x and returns the result."
  {:inline (fn [& args] `(. clojure.lang.Numbers (minus ~@args)))
   :inline-arities #{1 2}
   :added "1.0"}
  ([x] (. clojure.lang.Numbers (minus x)))
  ([x y] (. clojure.lang.Numbers (minus x y)))
  ([x y & more]
   (reduce - (- x y) more)))
Vars in clojure.core/-: defn reduce

Comments top

No comments for -. Log in to add a comment.