ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-dev:47045] [ruby-trunk - Feature #7877] E::Lazy#with_index needed
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
@ 2013-02-19  6:26 ` nobu (Nobuyoshi Nakada)
  2013-02-19  7:17 ` [ruby-dev:47046] " marcandre (Marc-Andre Lafortune)
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: nobu (Nobuyoshi Nakada) @ 2013-02-19  6:26 UTC (permalink / raw)
  To: ruby developers list


Issue #7877 has been updated by nobu (Nobuyoshi Nakada).

File 0001-enumerator.c-Enumerator-Lazy-with_index.patch added
Description updated


----------------------------------------
Feature #7877: E::Lazy#with_index needed
https://bugs.ruby-lang.org/issues/7877#change-36599

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/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:47046] [ruby-trunk - Feature #7877] E::Lazy#with_index needed
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
  2013-02-19  6:26 ` [ruby-dev:47045] [ruby-trunk - Feature #7877] E::Lazy#with_index needed nobu (Nobuyoshi Nakada)
@ 2013-02-19  7:17 ` marcandre (Marc-Andre Lafortune)
  2013-02-19 11:43 ` [ruby-dev:47047] " shyouhei (Shyouhei Urabe)
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: marcandre (Marc-Andre Lafortune) @ 2013-02-19  7:17 UTC (permalink / raw)
  To: ruby developers list


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/

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:47047] [ruby-trunk - Feature #7877] E::Lazy#with_index needed
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
  2013-02-19  6:26 ` [ruby-dev:47045] [ruby-trunk - Feature #7877] E::Lazy#with_index needed nobu (Nobuyoshi Nakada)
  2013-02-19  7:17 ` [ruby-dev:47046] " marcandre (Marc-Andre Lafortune)
@ 2013-02-19 11:43 ` shyouhei (Shyouhei Urabe)
  2013-02-19 16:30 ` [ruby-dev:47050] " marcandre (Marc-Andre Lafortune)
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: shyouhei (Shyouhei Urabe) @ 2013-02-19 11:43 UTC (permalink / raw)
  To: ruby developers list


Issue #7877 has been updated by shyouhei (Shyouhei Urabe).

Description updated

OK, so @marcandre is interested in.  I re-wrote the description in English.
----------------------------------------
Feature #7877: E::Lazy#with_index needed
https://bugs.ruby-lang.org/issues/7877#change-36605

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


=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:47050] [ruby-trunk - Feature #7877] E::Lazy#with_index needed
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2013-02-19 11:43 ` [ruby-dev:47047] " shyouhei (Shyouhei Urabe)
@ 2013-02-19 16:30 ` marcandre (Marc-Andre Lafortune)
  2013-02-20  6:01 ` [ruby-dev:47056] " shyouhei (Shyouhei Urabe)
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: marcandre (Marc-Andre Lafortune) @ 2013-02-19 16:30 UTC (permalink / raw)
  To: ruby developers list


Issue #7877 has been updated by marcandre (Marc-Andre Lafortune).


Note that (thanks to #7715), you can use `with_index` without a block and follow it with `map`:

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

I'm neutral about this feature request. The problem I see is that it's too late for 2.0.0 and it would introduce potential incompatibility in next minor.
----------------------------------------
Feature #7877: E::Lazy#with_index needed
https://bugs.ruby-lang.org/issues/7877#change-36623

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


=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:47056] [ruby-trunk - Feature #7877] E::Lazy#with_index needed
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2013-02-19 16:30 ` [ruby-dev:47050] " marcandre (Marc-Andre Lafortune)
@ 2013-02-20  6:01 ` shyouhei (Shyouhei Urabe)
  2013-04-05  2:32 ` [ruby-dev:47225] " zzak (Zachary Scott)
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: shyouhei (Shyouhei Urabe) @ 2013-02-20  6:01 UTC (permalink / raw)
  To: ruby developers list


Issue #7877 has been updated by shyouhei (Shyouhei Urabe).


@marcandre oh, thank you!  You saved my day.

Still I want this though.


----------------------------------------
Feature #7877: E::Lazy#with_index needed
https://bugs.ruby-lang.org/issues/7877#change-36647

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


=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:47225] [ruby-trunk - Feature #7877] E::Lazy#with_index needed
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2013-02-20  6:01 ` [ruby-dev:47056] " shyouhei (Shyouhei Urabe)
@ 2013-04-05  2:32 ` zzak (Zachary Scott)
  2013-04-05  4:21 ` [ruby-dev:47226] " duerst (Martin Dürst)
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: zzak (Zachary Scott) @ 2013-04-05  2:32 UTC (permalink / raw)
  To: ruby developers list


Issue #7877 has been updated by zzak (Zachary Scott).


Propose to move this to next major?
----------------------------------------
Feature #7877: E::Lazy#with_index needed
https://bugs.ruby-lang.org/issues/7877#change-38245

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


=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:47226] [ruby-trunk - Feature #7877] E::Lazy#with_index needed
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (5 preceding siblings ...)
  2013-04-05  2:32 ` [ruby-dev:47225] " zzak (Zachary Scott)
@ 2013-04-05  4:21 ` duerst (Martin Dürst)
  2013-06-02  5:50 ` [ruby-dev:47390] " zzak (Zachary Scott)
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: duerst (Martin Dürst) @ 2013-04-05  4:21 UTC (permalink / raw)
  To: ruby developers list


Issue #7877 has been updated by duerst (Martin Dürst).


zzak (Zachary Scott) wrote:
> Propose to move this to next major?

Do you mean because of "potential incompatibility" (https://bugs.ruby-lang.org/issues/7877#note-4)? What exactly would this incompatibility be? To me, it seems that lazy.with_index would just work, so we should just fix it. Next major seems way too long to wait.
----------------------------------------
Feature #7877: E::Lazy#with_index needed
https://bugs.ruby-lang.org/issues/7877#change-38252

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


=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:47390] [ruby-trunk - Feature #7877] E::Lazy#with_index needed
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (6 preceding siblings ...)
  2013-04-05  4:21 ` [ruby-dev:47226] " duerst (Martin Dürst)
@ 2013-06-02  5:50 ` zzak (Zachary Scott)
  2013-06-02  7:31 ` [ruby-dev:47392] [ruby-trunk - Bug #7877] E::Lazy#with_index should be lazy zzak (Zachary Scott)
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: zzak (Zachary Scott) @ 2013-06-02  5:50 UTC (permalink / raw)
  To: ruby developers list


Issue #7877 has been updated by zzak (Zachary Scott).


@duerst You're probably right, since this feature was introduced in 2.0.0

If yhara-san wants to implement #with_index with a block then I see no problem with introducing this in 2.1.0
----------------------------------------
Feature #7877: E::Lazy#with_index needed
https://bugs.ruby-lang.org/issues/7877#change-39621

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


=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:47392] [ruby-trunk - Bug #7877] E::Lazy#with_index should be lazy
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (7 preceding siblings ...)
  2013-06-02  5:50 ` [ruby-dev:47390] " zzak (Zachary Scott)
@ 2013-06-02  7:31 ` zzak (Zachary Scott)
  2014-01-30  6:16 ` [ruby-dev:47932] " shibata.hiroshi
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: zzak (Zachary Scott) @ 2013-06-02  7:31 UTC (permalink / raw)
  To: ruby developers list


Issue #7877 has been updated by zzak (Zachary Scott).

Tracker changed from Feature to Bug
Subject changed from E::Lazy#with_index needed to E::Lazy#with_index should be lazy
Target version changed from next minor to current: 2.1.0
ruby -v set to 2.1.0-dev
Backport set to 2.0.0: UNKNOWN


----------------------------------------
Bug #7877: E::Lazy#with_index should be lazy
https://bugs.ruby-lang.org/issues/7877#change-39637

Author: shyouhei (Shyouhei Urabe)
Status: Assigned
Priority: Normal
Assignee: yhara (Yutaka HARA)
Category: core
Target version: current: 2.1.0
ruby -v: 2.1.0-dev
Backport: 2.0.0: UNKNOWN


=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:47932] [ruby-trunk - Bug #7877] E::Lazy#with_index should be lazy
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (8 preceding siblings ...)
  2013-06-02  7:31 ` [ruby-dev:47392] [ruby-trunk - Bug #7877] E::Lazy#with_index should be lazy zzak (Zachary Scott)
@ 2014-01-30  6:16 ` shibata.hiroshi
  2014-07-16 14:03 ` [ruby-dev:48412] " nakilon
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: shibata.hiroshi @ 2014-01-30  6:16 UTC (permalink / raw)
  To: ruby-dev

Issue #7877 has been updated by Hiroshi SHIBATA.

Target version changed from 2.1.0 to current: 2.2.0

----------------------------------------
Bug #7877: E::Lazy#with_index should be lazy
https://bugs.ruby-lang.org/issues/7877#change-44758

* Author: Shyouhei Urabe
* Status: Assigned
* Priority: Normal
* Assignee: Yutaka HARA
* Category: core
* Target version: current: 2.2.0
* ruby -v: 2.1.0-dev
* Backport: 2.0.0: UNKNOWN
----------------------------------------
=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end

---Files--------------------------------
0001-enumerator.c-Enumerator-Lazy-with_index.patch (3.33 KB)


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:48412] [ruby-trunk - Bug #7877] E::Lazy#with_index should be lazy
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (9 preceding siblings ...)
  2014-01-30  6:16 ` [ruby-dev:47932] " shibata.hiroshi
@ 2014-07-16 14:03 ` nakilon
  2016-08-08  1:59 ` [ruby-dev:49751] [Ruby trunk Bug#7877] " shyouhei
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: nakilon @ 2014-07-16 14:03 UTC (permalink / raw)
  To: ruby-dev

Issue #7877 has been updated by Victor Maslov.


Is it related? http://stackoverflow.com/q/24782712/322020

----------------------------------------
Bug #7877: E::Lazy#with_index should be lazy
https://bugs.ruby-lang.org/issues/7877#change-47808

* Author: Shyouhei Urabe
* Status: Assigned
* Priority: Normal
* Assignee: Yutaka HARA
* Category: core
* Target version: current: 2.2.0
* ruby -v: 2.1.0-dev
* Backport: 2.0.0: UNKNOWN
----------------------------------------
=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end

---Files--------------------------------
0001-enumerator.c-Enumerator-Lazy-with_index.patch (3.33 KB)


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:49751] [Ruby trunk Bug#7877] E::Lazy#with_index should be lazy
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (10 preceding siblings ...)
  2014-07-16 14:03 ` [ruby-dev:48412] " nakilon
@ 2016-08-08  1:59 ` shyouhei
  2016-10-11  7:18 ` [ruby-dev:49834] " shyouhei
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 15+ messages in thread
From: shyouhei @ 2016-08-08  1:59 UTC (permalink / raw)
  To: ruby-dev

Issue #7877 has been updated by Shyouhei Urabe.


Is there reason this is not loved?  I'd like to have this.

----------------------------------------
Bug #7877: E::Lazy#with_index should be lazy
https://bugs.ruby-lang.org/issues/7877#change-59980

* Author: Shyouhei Urabe
* Status: Assigned
* Priority: Normal
* Assignee: Yutaka HARA
* ruby -v: 2.1.0-dev
* Backport: 2.0.0: UNKNOWN
----------------------------------------
=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end

---Files--------------------------------
0001-enumerator.c-Enumerator-Lazy-with_index.patch (3.33 KB)


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:49834] [Ruby trunk Bug#7877] E::Lazy#with_index should be lazy
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (11 preceding siblings ...)
  2016-08-08  1:59 ` [ruby-dev:49751] [Ruby trunk Bug#7877] " shyouhei
@ 2016-10-11  7:18 ` shyouhei
  2019-08-08 20:45 ` [ruby-dev:50829] [Ruby master " merch-redmine
  2019-08-09  8:07 ` [ruby-dev:50831] " nobu
  14 siblings, 0 replies; 15+ messages in thread
From: shyouhei @ 2016-10-11  7:18 UTC (permalink / raw)
  To: ruby-dev

Issue #7877 has been updated by Shyouhei Urabe.

Assignee changed from Yutaka HARA to Nobuyoshi Nakada

----------------------------------------
Bug #7877: E::Lazy#with_index should be lazy
https://bugs.ruby-lang.org/issues/7877#change-60824

* Author: Shyouhei Urabe
* Status: Assigned
* Priority: Normal
* Assignee: Nobuyoshi Nakada
* ruby -v: 2.1.0-dev
* Backport: 2.0.0: UNKNOWN
----------------------------------------
=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end

---Files--------------------------------
0001-enumerator.c-Enumerator-Lazy-with_index.patch (3.33 KB)


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:50829] [Ruby master Bug#7877] E::Lazy#with_index should be lazy
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (12 preceding siblings ...)
  2016-10-11  7:18 ` [ruby-dev:49834] " shyouhei
@ 2019-08-08 20:45 ` merch-redmine
  2019-08-09  8:07 ` [ruby-dev:50831] " nobu
  14 siblings, 0 replies; 15+ messages in thread
From: merch-redmine @ 2019-08-08 20:45 UTC (permalink / raw)
  To: ruby-dev

Issue #7877 has been updated by jeremyevans0 (Jeremy Evans).

File lazy-with-index-block-7877.patch added

This bug is still present in the master branch.  I've updated nobu's patch to apply to the master branch, which required a significant rewrite.  The updated patch is attached.

----------------------------------------
Bug #7877: E::Lazy#with_index should be lazy
https://bugs.ruby-lang.org/issues/7877#change-80500

* Author: shyouhei (Shyouhei Urabe)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Target version: 
* ruby -v: 2.1.0-dev
* Backport: 2.0.0: UNKNOWN
----------------------------------------
=begin
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

  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.
=end

---Files--------------------------------
0001-enumerator.c-Enumerator-Lazy-with_index.patch (3.33 KB)
lazy-with-index-block-7877.patch (4.08 KB)


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [ruby-dev:50831] [Ruby master Bug#7877] E::Lazy#with_index should be lazy
       [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
                   ` (13 preceding siblings ...)
  2019-08-08 20:45 ` [ruby-dev:50829] [Ruby master " merch-redmine
@ 2019-08-09  8:07 ` nobu
  14 siblings, 0 replies; 15+ messages in thread
From: nobu @ 2019-08-09  8:07 UTC (permalink / raw)
  To: ruby-dev

Issue #7877 has been updated by nobu (Nobuyoshi Nakada).

Assignee changed from nobu (Nobuyoshi Nakada) to jeremyevans0 (Jeremy Evans)
Description updated

Thank you, I've missed it.

----------------------------------------
Bug #7877: E::Lazy#with_index should be lazy
https://bugs.ruby-lang.org/issues/7877#change-80515

* Author: shyouhei (Shyouhei Urabe)
* Status: Assigned
* Priority: Normal
* Assignee: jeremyevans0 (Jeremy Evans)
* Target version: 
* ruby -v: 2.1.0-dev
* Backport: 2.0.0: UNKNOWN
----------------------------------------
So I wanted some real benefit of being lazy.  I wrote a Leibniz formula:

```ruby
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.


---Files--------------------------------
0001-enumerator.c-Enumerator-Lazy-with_index.patch (3.33 KB)
lazy-with-index-block-7877.patch (4.08 KB)


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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-08-09  8:07 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-7877.20130218202740@ruby-lang.org>
2013-02-19  6:26 ` [ruby-dev:47045] [ruby-trunk - Feature #7877] E::Lazy#with_index needed nobu (Nobuyoshi Nakada)
2013-02-19  7:17 ` [ruby-dev:47046] " marcandre (Marc-Andre Lafortune)
2013-02-19 11:43 ` [ruby-dev:47047] " shyouhei (Shyouhei Urabe)
2013-02-19 16:30 ` [ruby-dev:47050] " marcandre (Marc-Andre Lafortune)
2013-02-20  6:01 ` [ruby-dev:47056] " shyouhei (Shyouhei Urabe)
2013-04-05  2:32 ` [ruby-dev:47225] " zzak (Zachary Scott)
2013-04-05  4:21 ` [ruby-dev:47226] " duerst (Martin Dürst)
2013-06-02  5:50 ` [ruby-dev:47390] " zzak (Zachary Scott)
2013-06-02  7:31 ` [ruby-dev:47392] [ruby-trunk - Bug #7877] E::Lazy#with_index should be lazy zzak (Zachary Scott)
2014-01-30  6:16 ` [ruby-dev:47932] " shibata.hiroshi
2014-07-16 14:03 ` [ruby-dev:48412] " nakilon
2016-08-08  1:59 ` [ruby-dev:49751] [Ruby trunk Bug#7877] " shyouhei
2016-10-11  7:18 ` [ruby-dev:49834] " shyouhei
2019-08-08 20:45 ` [ruby-dev:50829] [Ruby master " merch-redmine
2019-08-09  8:07 ` [ruby-dev:50831] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).