[#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:86267] [Ruby trunk Feature#14625] yield_self accepts an argument, calling to_proc
From:
shevegen@...
Date:
2018-03-23 19:48:06 UTC
List:
ruby-core #86267
Issue #14625 has been updated by shevegen (Robert A. Heiler).
I can't answer all questions zverok posed but in regards to:
.yield_self(method :filter2)
versus
.yield_self(&method(:filter1))
The first variant is cleaner IMO.
As for (&.:filter1) I don't really like that suggestion and
I think it should not be connected to irohiroki's issue
request here since he did not suggest it. :)
While I agree that it would be great if we could have a
way to also pass in arguments rather than just invoke
method calls vie e. g. array.map(&:strip) alone, I am
not convinced that **&.:** should be the way to go. It
looks very perlish and the dots are not so easily
distinguishable. So on that, I think we should keep
towards the suggestion itself given by irohiroki. And
I think he meant it only for yield_self, not for any
other method. Of course one can argue that symmetry
should exist for all methods (though I am not sure as
to why, other than thinking that symmetry is more
important even if it may be useless for some methods).
----------------------------------------
Feature #14625: yield_self accepts an argument, calling to_proc
https://bugs.ruby-lang.org/issues/14625#change-71176
* 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>