Issue #13601 has been updated by shyouhei (Shyouhei Urabe).

Status changed from Open to Closed

Closing as per request.

----------------------------------------
Feature #13601: Remove yield_self from Ruby 2.5 (already implemented)
https://bugs.ruby-lang.org/issues/13601#change-65119

* Author: danielpclark (Daniel P. Clark)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
Issue https://bugs.ruby-lang.org/issues/6721 for adding `yield_self` is unnecessary as `BasicObject#instance_eval` will do the exact same thing.

~~~ruby
class BasicObject
  alias :yield_self :instance_eval
end

2.yield_self { |x| x*x } # => 4
~~~

I've tried all the examples of its given use cases and `BasicObject#instance_eval` will do them all.

In issue #6721 nobu said he didn't like the name `yield_self`.  I'm in agreement about the name.  Since `BasicObject#instance_eval` will already pipe in `self` and return the value of the block `yield_self` is not necessary.



-- 
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>