ruby-dev (Japanese) list archive (unofficial mirror)
 help / color / mirror / Atom feed
From: "zzak (Zachary Scott)" <zachary@zacharyscott•net>
To: ruby-dev@ruby-lang.org (ruby developers list)
Subject: [ruby-dev:47225] [ruby-trunk - Feature #7877] E::Lazy#with_index needed
Date: Fri, 5 Apr 2013 11:32:41 +0900	[thread overview]
Message-ID: <redmine.journal-38245.20130405113240@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-7877.20130218202740@ruby-lang.org


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/

  parent reply	other threads:[~2013-04-05  2:55 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 ` zzak (Zachary Scott) [this message]
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-38245.20130405113240@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).