Skip to content

Instantly share code, notes, and snippets.

@joshuatbrown
Created July 2, 2009 00:12
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 joshuatbrown/139190 to your computer and use it in GitHub Desktop.
Save joshuatbrown/139190 to your computer and use it in GitHub Desktop.
Fibonacci in Clojure
(defn fib [x]
(if (= x 0) 0
(if (= x 1) 1
(+ (fib (- x 1)) (fib (- x 2)))))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment