From: nakilon@gmail•com
To: ruby-dev@ruby-lang.org
Subject: [ruby-dev:48412] [ruby-trunk - Bug #7877] E::Lazy#with_index should be lazy
Date: Wed, 16 Jul 2014 14:03:04 +0000 [thread overview]
Message-ID: <redmine.journal-47808.20140716140303.c4c7c19080305bdf@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-7877.20130218202740@ruby-lang.org
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/
next prev parent reply other threads:[~2014-07-16 13:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[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 ` nakilon [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-47808.20140716140303.c4c7c19080305bdf@ruby-lang.org \
--to=ruby-dev@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).