Skip to content

Instantly share code, notes, and snippets.

@kindlychung
Created January 14, 2015 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kindlychung/1cc5897b4e3b28af67d1 to your computer and use it in GitHub Desktop.
Save kindlychung/1cc5897b4e3b28af67d1 to your computer and use it in GitHub Desktop.
(defn sum [xs] (reduce + xs))
(defn avg [xs] (/ (sum xs) (count xs)))
(sum [1 2 3])
(avg [1 2 3])
(defn stats [numbers]
(map #(% numbers) [count sum avg])
)
(stats [1 2 3 4])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment