frequencies

clojure.contrib.seq

  • (frequencies coll)
DEPRECATED. Prefer clojure.core version.
Returns a map from distinct items in coll to the number of times
they appear.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/seq.clj:89 top

(defn frequencies
  "DEPRECATED. Prefer clojure.core version.
  Returns a map from distinct items in coll to the number of times
  they appear."
  {:deprecated "1.2"}
  [coll]
  (reduce (fn [counts x]
              (assoc counts x (inc (get counts x 0))))
          {} coll))
Vars in clojure.contrib.seq/frequencies: assoc defn fn frequencies get inc reduce
Used in 0 other vars

Comments top

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