Created
July 31, 2016 18:19
-
-
Save staafl/428a25fa5f745a3c0ca6209af2940009 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 problem26-fibs [x] | |
(let [fibs | |
((fn fibs [so-far] | |
(lazy-seq | |
(fibs | |
(cons (+ (first so-far) (second so-far)) so-far) | |
))) | |
'(1 1))] | |
(take x fibs))) | |
(user=> (problem26-fibs 1) | |
ArithmeticException integer overflow clojure.lang.Numbers.throwIntOverflow (Num | |
bers.java:1501) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment