Skip to content

Instantly share code, notes, and snippets.

@manishym
Created December 25, 2011 06:02
Show Gist options
  • Save manishym/1518787 to your computer and use it in GitHub Desktop.
Save manishym/1518787 to your computer and use it in GitHub Desktop.
Fibonacci in lisp - iteration - loop
(defun fib-loop (num)
(do ((n 0 (1+ n))
(cur 0 next)
(next 1 (+ cur next)))
((= num n) cur)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment