Skip to content

Instantly share code, notes, and snippets.

@ponzao
Created July 26, 2010 21:55
Show Gist options
  • Select an option

  • Save ponzao/491319 to your computer and use it in GitHub Desktop.

Select an option

Save ponzao/491319 to your computer and use it in GitHub Desktop.
(defn char-counter [str]
(reduce
(fn [m c]
(assoc m c (inc (get m c 0))))
{}
str))
@ponzao

ponzao commented Jul 26, 2010

Copy link
Copy Markdown
Author

It seems I rewrote a core-function (frequencies).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment