[#85940] [Ruby trunk Bug#14578] Forking a child process inside of a mutex crashes the ruby interpreter — ben.govero@...
Issue #14578 has been reported by bengovero (Ben Govero).
3 messages
2018/03/05
[#86205] [Ruby trunk Feature#14618] Add display width method to String for CLI — aycabta@...
Issue #14618 has been reported by aycabta (aycabta .).
3 messages
2018/03/19
[#86366] Re: [ruby-cvs:70102] usa:r63008 (trunk): get rid of test error/failure on Windows introduced at r62955 — Eric Wong <normalperson@...>
usa@ruby-lang.org wrote:
3 messages
2018/03/28
[ruby-core:86261] [Ruby trunk Feature#14625] yield_self accepts an argument, calling to_proc
From:
zverok.offline@...
Date:
2018-03-23 08:41:08 UTC
List:
ruby-core #86261
Issue #14625 has been updated by zverok (Victor Shepelev). Question 1. How is this (proposed): ```ruby result = collection .yield_self(method :filter1) .yield_self(method :filter2) ``` better than this (already works): ```ruby result = collection .yield_self(&method(:filter1)) .yield_self(&method(:filter2)) ``` ? Question 2: what about all other methods that accepts blocks of code? If the syntax shown above is available for `#yield_self`, shouldn't it become available for `#each`, `#map` and everything else?.. ```ruby collection.yield_self(method :filter1) collection.map(method :filter1) ``` I believe that the real improvement of "passing the method" situation would be the #13581, so you can write something like: ```ruby collection .yield_self(&.:filter1) .yield_self(&.:filter2) ``` ---------------------------------------- Feature #14625: yield_self accepts an argument, calling to_proc https://bugs.ruby-lang.org/issues/14625#change-71169 * Author: irohiroki (Hiroki Yoshioka) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- Currently, yield_self doesn't accept any argument other than a block. But there are situations where I would like to pass a method object to yield_self. e.g. ~~~ ruby result = collection .yield_self(&method(:filter1)) .yield_self(&method(:filter2)) ~~~ Of course, we can get the same result with ~~~ ruby result = filter2(filter1(collection)) ~~~ but the order of reading/writing doesn't match the order of thinking. My request is for yield_self to accept a proc-ish object and call to_proc on it so that we can write the code as shown below, which is more readable. ~~~ ruby result = collection .yield_self(method :filter1) .yield_self(method :filter2) ~~~ -- 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>