[#46908] [ruby-trunk - Bug #7774][Assigned] IFUNC上のbinding呼び出しでSEGV — "ktsj (Kazuki Tsujimoto)" <kazuki@...>

16 messages 2013/02/03

[#47075] [ruby-trunk - Bug #7924][Open] r39232 以降 net/http で正しく reponse を取得出来ないケースがある — "hsbt (Hiroshi SHIBATA)" <shibata.hiroshi@...>

15 messages 2013/02/23

[ruby-dev:47046] [ruby-trunk - Feature #7877] E::Lazy#with_index needed

From: "marcandre (Marc-Andre Lafortune)" <ruby-core@...>
Date: 2013-02-19 07:17:40 UTC
List: ruby-dev #47046
Issue #7877 has been updated by marcandre (Marc-Andre Lafortune).


See #7696 on how to handle state...
----------------------------------------
Feature #7877: E::Lazy#with_index needed
https://bugs.ruby-lang.org/issues/7877#change-36600

Author: shyouhei (Shyouhei Urabe)
Status: Assigned
Priority: Normal
Assignee: yhara (Yutaka HARA)
Category: core
Target version: next minor


=begin
なんかLazyの有効な例を出そうと思ってそうだライプニッツ級数だ!ということで

  def leibniz(n)
    (0..Float::INFINITY).lazy.with_index {|i, j| (-1 ** j) / (2*i+1).to_f }.take(n).reduce(:+)
  end

とかやっても動かない(いや動くけど。止まらん)。残念です。これあったほうが便利じゃないですかね。どうでしょう。

あ、もちろん2.0.0以降でOKです。
=end


-- 
http://bugs.ruby-lang.org/

In This Thread

Prev Next