diff options
author | scgilardi <scgilardi@gmail.com> | 2009-04-25 22:03:31 +0000 |
---|---|---|
committer | scgilardi <scgilardi@gmail.com> | 2009-04-25 22:03:31 +0000 |
commit | 2fcbab33cb2e616911470941f6a29ce74d75e037 (patch) | |
tree | ded9ca98c67ef052405cfdf8ecf5932698bbcfe5 | |
parent | 9d4dcf62eb2b8b04dd877dc41e4f4c714bdb834a (diff) |
fix doc strings and comments, report from Michael Wood
-rw-r--r-- | src/clojure/contrib/lazy_seqs.clj | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/clojure/contrib/lazy_seqs.clj b/src/clojure/contrib/lazy_seqs.clj index cf83b5de..17ffd5c3 100644 --- a/src/clojure/contrib/lazy_seqs.clj +++ b/src/clojure/contrib/lazy_seqs.clj @@ -15,7 +15,7 @@ ;; 7 from consideration by incrementing past them. Also inspired ;; by code from Christophe Grand in [2]. ;; -;; fibs - attributed to 'every haskell beginner tutorial' +;; fibs - all the Fibonacci numbers ;; ;; powers-of-2 - all the powers of 2 ;; @@ -53,12 +53,12 @@ (primes-from 11 wheel)))) "Lazy sequence of all the prime numbers.") -(defn fibs [] +(defn fibs "Returns a lazy sequence of all the Fibonacci numbers." + [] (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1]))) -(defn powers-of-2 [] +(defn powers-of-2 "Returns a lazy sequence of all the powers of 2" + [] (iterate #(bit-shift-left % 1) 1)) - - |