Created
September 28, 2013 18:53
-
-
Save ErikBjare/6745205 to your computer and use it in GitHub Desktop.
My first lisp function, calculates the fibonacci sequence.
This file contains 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
(defun fib (l n) | |
(if (< (length l) n) | |
(fib (append l (list (apply #'+ (last l 2)))) n) | |
l | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment