From: Charles Nutter <headius@headius.com>
To: ruby-core@ruby-lang.org
Subject: [ruby-core:35920] [Ruby 1.9 - Feature #4589] add Queue#each() method and include Enumerable
Date: Wed, 27 Apr 2011 13:06:00 +0900 [thread overview]
Message-ID: <redmine.journal-16670.20110427130600@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-4589.20110420214926@ruby-lang.org
Issue #4589 has been updated by Charles Nutter.
At first I thought this would be a good idea. But then I realized that #each is, in every case I can think of, a non-mutating operation. Since I assume you meant for Queue#each to pop all elements off the queue, this would be the first example I know of a mutating #each.
Also, what happens when the queue is empty? Does it wait for another element, or does it end the iteration?
The behavior of #each over a queue seems fuzzy to me, and without a clear specification of what you want I don't see a path forward.
----------------------------------------
Feature #4589: add Queue#each() method and include Enumerable
http://redmine.ruby-lang.org/issues/4589
Author: Suraj Kurapati
Status: Open
Priority: Normal
Assignee:
Category: lib
Target version:
Please add a thread-safe each() method to the Queue and SizedQueue classes
which are provided by the "thread" standard library
Also mix-in the Enumerable module into those classes so we can use map/inject/etc.
Thanks for your consideration.
--
http://redmine.ruby-lang.org
next prev parent reply other threads:[~2011-04-27 4:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-20 12:49 [ruby-core:35828] [Ruby 1.9 - Feature #4589][Open] add Queue#each() method and include Enumerable redmine
2011-04-27 4:06 ` Charles Nutter [this message]
2011-04-28 21:52 ` [ruby-core:35941] [Ruby 1.9 - Feature #4589] " Eric Hodel
2011-07-26 18:21 ` [ruby-core:38528] " Suraj Kurapati
2011-07-26 23:34 ` [ruby-core:38536] " Eric Hodel
2011-07-27 9:41 ` [ruby-core:38559] " Alex Young
2012-03-25 6:20 ` [ruby-core:43618] [ruby-trunk - Feature #4589][Assigned] " mame (Yusuke Endoh)
2012-10-29 23:44 ` [ruby-core:48561] [ruby-trunk - Feature #4589][Feedback] " ko1 (Koichi Sasada)
2012-10-30 2:36 ` [ruby-core:48584] " Aaron Patterson
2017-01-31 9:10 ` [ruby-core:79348] [Ruby trunk Feature#4589][Closed] " ko1
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-16670.20110427130600@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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).