Created
May 2, 2013 08:27
-
-
Save vishesh/5500923 to your computer and use it in GitHub Desktop.
Generate a lazy sequence of fibonacci numbers
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 fibs [] | |
| "Generate a lazy sequence of fibonacci numbers" | |
| (lazy-cat '(0 1) | |
| (map + (fibs ) (rest (fibs ))))) | |
| (println (take 20 (fibs ))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment