From: "Jörg W Mittag" Date: 2009-07-14T01:20:06+09:00 Subject: Re: Fibonacci numbers - newbie question. Todd Benson wrote: > The first time I saw this problem, I did the recursive thing, but I > just _had_ to use #inject, so for a full list... > > n = 10 > (0...n-1).inject([0,1]) {|a, i| a.push(a[-2] + a[-1])} Although, when it comes to Fibonacci, Haskell just rules, IMHO: fibs = 0 : 1 : zipWith (+) fibs (tail fibs) Zipping an infinite list with itself to produce itself ... brilliant. jwm