Last active
December 29, 2019 17:17
-
-
Save gsscoder/d781d2734012fcd1fc1ac36dc11a907b to your computer and use it in GitHub Desktop.
LFE snippet to calculate factorial of a number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "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