Actions
Feature #13601
closedRemove yield_self from Ruby 2.5 (already implemented)
Status:
Closed
Assignee:
-
Target version:
-
Description
Issue https://bugs.ruby-lang.org/issues/6721 for adding yield_self
is unnecessary as BasicObject#instance_eval
will do the exact same thing.
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.
Actions
Like0
Like0Like0Like0Like0