Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active May 27, 2017 14:09
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 deque-blog/4fd178785624c38ce50f579c1b7aaa73 to your computer and use it in GitHub Desktop.
Save deque-blog/4fd178785624c38ce50f579c1b7aaa73 to your computer and use it in GitHub Desktop.
(defn fibo-lazy-seq
[^long n]
(letfn [(fibs [a b] (cons a (lazy-seq (fibs b (+ a b)))))]
(nth (fibs 0N 1N) n)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment