Changes for clojure.core/lazy-seq

Stathis Sideris on Wed, 05 Sep 2012
;; A lazy-seq of Fibonacci numbers (fn = fn-1 + fn-2)
;; The producer function takes exactly two parameters
;; (because we need the last 2 elements to produce a new one)
user=> (defn fib [a b] (cons a (lazy-seq (fib b (+ b a)))))

user=> (take 5 (fib 1 1))
(1 1 2 3 5)
redraiment on Sat, 05 May 2012
;; A lazy-seq of Fibonacci numbers (fn = fn-1 + fn-2)
;; The producer function takes exactly two parameters
;; (because we need the last 2 elements to produce a new one)
user=> (defn fib [a b] (lazy-seq (cons a (fib b (+ b a)))))

user=> (take 5 (fib 1 1))
(1 1 2 3 5)
jakubholynet on Wed, 23 Nov 2011
;; A lazy-seq of Fibonacci numbers (fn = fn-1 + fn-2)
;; The producer function takes exactly two parameters
;; (because we need the last 2 elements to produce a new one)
user=> (defn fib [a b] (lazy-seq (cons a (fib b (+ b a)))))

user=> take 5 (fib 1 1))
(1 1 2 3 5)
jakubholynet on Wed, 23 Nov 2011
;; A lazy-seq of Fibonacci numbers (fn = fn-1 + fn-2)
;; The producer function takes exactly two parameters
;; (i.e. we need the last 2 elements to produce a new one)
user=> (defn fib [a b] (lazy-seq (cons a (fib b (+ b a)))))

user=> take 5 (fib 1 1))
(1 1 2 3 5)
jakubholynet on Wed, 23 Nov 2011
;; A lazy-seq of Fibonacci numbers (fn = fn-1 + fn-2)
;; The producer function takes exactly two parameters
user=> (defn fib [a b] (lazy-seq (cons a (fib b (+ b a)))))

user=> take 5 (fib 1 1))
(1 1 2 3 5)