Last active
May 27, 2017 14:08
-
-
Save deque-blog/40cdb69beaeac5eadc34925fd7c590c6 to your computer and use it in GitHub Desktop.
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
(defn fibo-trampoline | |
[^long n] | |
(letfn [(fibs [curr next ^long n] | |
(if-not (zero? n) | |
#(fibs next (+ curr next) (dec n)) | |
curr))] | |
(trampoline (fibs 0N 1N n)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment