[#84280] [Ruby trunk Bug#14181] hangs or deadlocks from waitpid, threads, and trapping SIGCHLD — nobu@...
Issue #14181 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/12/15
[#84398] [Ruby trunk Bug#14220] WEBrick changes - failures on MSWIN, MinGW — Greg.mpls@...
Issue #14220 has been reported by MSP-Greg (Greg L).
3 messages
2017/12/22
[#84472] Re: [ruby-dev:50394] [Ruby trunk Bug#14240] warn four special variables: $; $, $/ $\ — Eric Wong <normalperson@...>
Shouldn't English posts be on ruby-core instead of ruby-dev?
3 messages
2017/12/26
[ruby-core:84384] [Ruby trunk Feature#12318] Returning the evaluated value of a block
From:
andrew@...
Date:
2017-12-21 06:15:12 UTC
List:
ruby-core #84384
Issue #12318 has been updated by avit (Andrew Vit).
This is now implemented as `yield_self`
Close please?
----------------------------------------
Feature #12318: Returning the evaluated value of a block
https://bugs.ruby-lang.org/issues/12318#change-68575
* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
I often achieve an element using an iterator with a block, and then apply the same/a similar block to the element I get. Examples are:
~~~ruby
[7, 8, 9]
.max_by{|e| e % 3}
.tap{|e| break e % 3}
# => 2
["foo", "bar", "baz"]
.find{|e| e[/(.)\1/]}
.tap{|e| break e[/(.)\1/]}
# => "oo"
~~~
I would like a method on `Enumerator` that returns the result of the block rather than the original element in the iterator. Not sure about the name, but if I call it `and_return` temporary, it should look like:
~~~ruby
[7, 8, 9]
.max_by.and_return{|e| e % 3}
# => 2
["foo", "bar", "baz"]
.find.and_return{|e| e[/(.)\1/]}
# => "oo"
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>