max-key

clojure.core

  • (max-key k x)
  • (max-key k x y)
  • (max-key k x y & more)
Returns the x for which (k x), a number, is greatest.

1 Example top

  • user=> (max-key count "asd" "bsd" "dsd" "long word")
    "long word"
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:4395 top

(defn max-key
  "Returns the x for which (k x), a number, is greatest."
  {:added "1.0"
   :static true}
  ([k x] x)
  ([k x y] (if (> (k x) (k y)) x y))
  ([k x y & more]
   (reduce1 #(max-key k %1 %2) (max-key k x y) more)))
Vars in clojure.core/max-key:
Used in 0 other vars

Comments top

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