Skip to content

Instantly share code, notes, and snippets.

@gsscoder
Last active December 29, 2019 17:17
Show Gist options
  • Select an option

  • Save gsscoder/d781d2734012fcd1fc1ac36dc11a907b to your computer and use it in GitHub Desktop.

Select an option

Save gsscoder/d781d2734012fcd1fc1ac36dc11a907b to your computer and use it in GitHub Desktop.
LFE snippet to calculate factorial of a number
"Copy and paste to LFE REPL to get: 3628800"
(defun factorial
((0) 1)
((n) (* n (factorial (- n 1)))))
(factorial 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment