Bug #7877
Updated by shyouhei (Shyouhei Urabe) almost 12 years ago
=begin So I wanted some real benefit of being lazy. I wrote a Leibniz formula: なんかLazyの有効な例を出そうと思ってそうだライプニッツ級数だ!ということで def leibniz(n) (0..Float::INFINITY).lazy.with_index {|i, j| (-1 ** j) / (2*i+1).to_f }.take(n).reduce(:+) end But it doesn't work (well, it does, indeed. It just doesn't stop working). I got frustrated. How about it? Don't you feel it nifty? とかやっても動かない(いや動くけど。止まらん)。残念です。これあったほうが便利じゃないですかね。どうでしょう。 Of course I can wait for the release next to 2.0.0. あ、もちろん2.0.0以降でOKです。 =end