Skip to content

Instantly share code, notes, and snippets.

@enigmaticape
Created November 4, 2012 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 enigmaticape/4013039 to your computer and use it in GitHub Desktop.
Save enigmaticape/4013039 to your computer and use it in GitHub Desktop.
Recursive Fibonacci in Scheme, a snippet from SICP
(define (fib n)
(cond ((= n 0) 0)
((= n 1) 1)
(else (+ (fib (- n 1))
(fib (- n 2))))))
@enigmaticape
Copy link
Author

From a discussion of the solution to SICP exercise 1.11 at http://www.enigmaticape.com/blog/sicp-exercise-1-11-iterative-function-fn/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment