[#28687] [Bug #2973] rb_bug - Segmentation fault - error.c:213 — rudolf gavlas <redmine@...>

Bug #2973: rb_bug - Segmentation fault - error.c:213

10 messages 2010/03/16

[#28735] [Bug #2982] Ruby tries to link with both openssl and readline — Lucas Nussbaum <redmine@...>

Bug #2982: Ruby tries to link with both openssl and readline

16 messages 2010/03/18

[#28736] [Bug #2983] Ruby (GPLv2 only) tries to link to with readline (now GPLv3) — Lucas Nussbaum <redmine@...>

Bug #2983: Ruby (GPLv2 only) tries to link to with readline (now GPLv3)

10 messages 2010/03/18

[#28907] [Bug #3000] Open SSL Segfaults — Christian Höltje <redmine@...>

Bug #3000: Open SSL Segfaults

19 messages 2010/03/23

[#28924] [Bug #3005] Ruby core dump - [BUG] rb_sys_fail() - errno == 0 — Sebastian YEPES <redmine@...>

Bug #3005: Ruby core dump - [BUG] rb_sys_fail() - errno == 0

10 messages 2010/03/24

[#28954] [Feature #3010] slow require gems in ruby 1.9.1 — Miao Jiang <redmine@...>

Feature #3010: slow require gems in ruby 1.9.1

15 messages 2010/03/24

[#29179] [Bug #3071] Convert rubygems and rdoc to use psych — Aaron Patterson <redmine@...>

Bug #3071: Convert rubygems and rdoc to use psych

10 messages 2010/03/31

[ruby-core:28388] [Feature #2515](Open) Array#select!

From: Roger Pack <redmine@...>
Date: 2010-03-01 19:34:51 UTC
List: ruby-core #28388
Issue #2515 has been updated by Roger Pack.

Status changed from Rejected to Open

Hmm.  

I personally have had uses for select! in the past, as others have as well.
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/27316
http://www.ruby-forum.com/topic/200640#875371

Currently we are forced to use reject! which is surprising...
Think of select! as a destructive version of select, which currently doesn't exist in the std lib.

For example if you have this (albeit trivial) example :

a = some_large_array
c = a.select{|b| b%2 == 1}

and then want to change this to a destructive select to the array, because it is very large, the first thing you try is

a.select!{|b| b %2 == 1}

But it surprisingly doesn't exist (reject has its destructive counterpart, map does too, but select doesn't), so you are forced to rewrite your boolean logic to use reject!

a.reject!{|b| (b%2) != 3}

which can be less readable, but more importantly--it is surprising to have to do so, at least to me.

It would be more convenient and less surprising to have a select!

Reopening.
Thanks.
-rp
----------------------------------------
http://redmine.ruby-lang.org/issues/show/2515

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

In This Thread