Skip to content

Instantly share code, notes, and snippets.

@michalmarczyk
Created June 21, 2010 18:05
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 michalmarczyk/447233 to your computer and use it in GitHub Desktop.
Save michalmarczyk/447233 to your computer and use it in GitHub Desktop.
;;; (set! *warn-on-reflection* true)
;;; for more spectacular results
(defn fact [n]
(loop [n (long n) r 1]
(if (zero? n)
r
(recur (num (dec n)) (* r n)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment