Skip to content

Instantly share code, notes, and snippets.

@drguildo
Created November 1, 2013 20:59
Show Gist options
  • Save drguildo/7271844 to your computer and use it in GitHub Desktop.
Save drguildo/7271844 to your computer and use it in GitHub Desktop.
(defn factorial [n]
(loop [n n
acc 1N]
(if (= n 0)
acc
(recur (dec n) (* acc n)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment