Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(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