[#75687] [Ruby trunk Bug#12416] struct rb_id_table lacks mark function — shyouhei@...
Issue #12416 has been reported by Shyouhei Urabe.
3 messages
2016/05/23
[#75763] [Ruby trunk Feature#12435] Using connect_nonblock to open TCP connections in Net::HTTP#connect — mohamed.m.m.hafez@...
Issue #12435 has been reported by Mohamed Hafez.
3 messages
2016/05/28
[#75774] Errno::EAGAIN thrown by OpenSSL::SSL::SSLSocket#connect_nonblock — Mohamed Hafez <mohamed.m.m.hafez@...>
Hi all, every now and then in my production server, I'm
4 messages
2016/05/30
[#75775] Re: Errno::EAGAIN thrown by OpenSSL::SSL::SSLSocket#connect_nonblock
— Mohamed Hafez <mohamed.m.m.hafez@...>
2016/05/30
Or does MRI's OpenSSL::SSL::SSLSocket#connect_nonblock just return
[#75782] Important: Somewhat backwards-incompatible change (Fwd: [ruby-cvs:62388] duerst:r55225 (trunk): * string.c: Activate full Unicode case mapping for UTF-8) — Martin J. Dürst <duerst@...>
With the change below, I have activated full Unicode case mapping for
4 messages
2016/05/31
[ruby-core:75430] [Ruby trunk Feature#12360] More useful return values from bang methods
From:
shyouhei@...
Date:
2016-05-10 07:12:24 UTC
List:
ruby-core #75430
Issue #12360 has been updated by Shyouhei Urabe.
reject! returns nil in case nothing was rejected at all. This is useful when a programmer wants to know if actual rejection happened or not, by using single if statement.
Returning rejected elements can be handy on some scenarios, though. Maybe a separate method?
----------------------------------------
Feature #12360: More useful return values from bang methods
https://bugs.ruby-lang.org/issues/12360#change-58548
* Author: Thomas Sawyer
* Status: Open
* Priority: Normal
* Assignee:
----------------------------------------
It would be nice if bang methods returned results that where of some additional use. Presently most just return the effected receiver.
For example, currently Array#reject! works as follows:
a = [1,2,3,4]
a.reject!{ |x| x % 2 == 0 }
=> [2,4]
a
=> [2,4]
So the return value of #reject! is useless b/c it is just the same as `a` (in this example). So why not return what was rejected instead:
a = [1,2,3,4]
a.reject!{ |x| x % 2 == 0 }
=> [1,3]
a
=> [2,4]
Now we have useful additional information -- we know exactly what got rejected. To do the same thing presently we would have to fully duplicate the original array and then take the difference -- two extra steps.
The downside is that the method would consume a little more memory and probably slow the method's execution a little too. But I tend to side with functionality when I use Ruby.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>