From: "shyouhei (Shyouhei Urabe)" <shyouhei@ruby-lang.org>
To: ruby-dev@ruby-lang.org (ruby developers list)
Subject: [ruby-dev:47047] [ruby-trunk - Feature #7877] E::Lazy#with_index needed
Date: Tue, 19 Feb 2013 20:43:17 +0900 [thread overview]
Message-ID: <redmine.journal-36605.20130219204317@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-7877.20130218202740@ruby-lang.org
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/
next prev parent reply other threads:[~2013-02-19 12:02 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 ` shyouhei (Shyouhei Urabe) [this message]
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
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-36605.20130219204317@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).