Created
December 25, 2011 06:02
-
-
Save manishym/1518787 to your computer and use it in GitHub Desktop.
Fibonacci in lisp - iteration - loop
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-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