[#89555] [Ruby trunk Feature#15251] Hash aset should deduplicate non tainted string — chopraanmol1@...
Issue #15251 has been updated by chopraanmol1 (Anmol Chopra).
3 messages
2018/10/25
[#89583] [PATCH] vm_trace.c (postponed_job_register): only hit main thread — Eric Wong <normalperson@...>
@hsbt: I post here on ruby-core because I hit errors with
5 messages
2018/10/27
[#89584] Re: [PATCH] vm_trace.c (postponed_job_register): only hit main thread
— Koichi Sasada <ko1@...>
2018/10/27
thank you for you patch.
[#89590] Re: [PATCH] vm_trace.c (postponed_job_register): only hit main thread
— Eric Wong <normalperson@...>
2018/10/28
Koichi Sasada <ko1@atdot.net> wrote:
[#89621] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — Greg.mpls@...
Issue #14867 has been updated by MSP-Greg (Greg L).
4 messages
2018/10/29
[#89622] Re: [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process
— Eric Wong <normalperson@...>
2018/10/29
Greg.mpls@gmail.com wrote:
[#89627] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — takashikkbn@...
Issue #14867 has been updated by k0kubun (Takashi Kokubun).
3 messages
2018/10/30
[#89654] [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process — takashikkbn@...
Issue #14867 has been updated by k0kubun (Takashi Kokubun).
4 messages
2018/10/31
[#89655] Re: [Ruby trunk Bug#14867] Process.wait can wait for MJIT compiler process
— Eric Wong <normalperson@...>
2018/10/31
takashikkbn@gmail.com wrote:
[ruby-core:89381] [Ruby trunk Feature#15113][Closed] Show warnings on unused blocks with Enumerable#all? any? one? none?
From:
duerst@...
Date:
2018-10-12 08:37:45 UTC
List:
ruby-core #89381
Issue #15113 has been updated by duerst (Martin D端rst).
Status changed from Open to Closed
Closed at proposer's request.
----------------------------------------
Feature #15113: Show warnings on unused blocks with Enumerable#all? any? one? none?
https://bugs.ruby-lang.org/issues/15113#change-74421
* Author: fursich (Onishi Koji)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
Let Array#any? (and related enumerable methods alike) to express warnings in case blocks are left unused.
**Background**
Certain methods in Array silently ignore the given blocks without any warnings, which sometimes causes 'invisible' bugs that are a bit hard to detect.
~~~ ruby
>> [1,2,3].any?(2) {|it| it > 10}
=> true
~~~
On the other hand, Array#index warns you (kindly enough!) when your blocks are left unused.
~~~ ruby
>> [1,2,3].index(2) {|it| it > 10}
(irb):3: warning: given block not used
=> 1
~~~
**Proposal**
This PR is to let Enumerable#all?, #any?, #one, #none? (including similar methods with Array and Hash) to show warning messages so as that it behaves in consistent manner with what we see with Array#index.
**Implementation**
https://github.com/ruby/ruby/pull/1953
Adding one conditional branch per one method call, which would cost very low in terms of computational cost. (benchmark-driver suggested somewhere around 1.00x-1.01x slower with Enumurator#any?)
Hopefully it would help reduce some of the unnecessary source of pain, and help us code happily;)
--
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>