Skip to content

Instantly share code, notes, and snippets.

@ErikBjare
Created September 28, 2013 18:53
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 ErikBjare/6745205 to your computer and use it in GitHub Desktop.
Save ErikBjare/6745205 to your computer and use it in GitHub Desktop.
My first lisp function, calculates the fibonacci sequence.
(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