From: matz@... Date: 2018-06-04T09:37:55+00:00 Subject: [ruby-core:87387] [Ruby trunk Feature#14821] aditional arguments to yield_self Issue #14821 has been updated by matz (Yukihiro Matsumoto). Your proposal makes the specific case simpler like your example, but in general, it makes the intention of `yield_self` (or `then`) less clear. Matz. p.s. I removed the previous comment because I made mistake. ---------------------------------------- Feature #14821: aditional arguments to yield_self https://bugs.ruby-lang.org/issues/14821#change-72373 * Author: DarkWiiPlayer (Dennis Fischer) * Status: Rejected * Priority: Normal * Assignee: * Target version: ---------------------------------------- Currently, `yield_self` only accepts a block as its single argument. I propose that it should also accept a series of additional arguments that get passed to the block after `self` This is what I mean: def yield_self(*args, &block) block.call(self, *args) end which would allow writing code like this some_object.yield_self(:name, :surname, &sort_stuff).do_more_stuff() instead of code like this some_object.yield_self{|x| sort_stuff.call(x, :name, :surname).do_more_stuff() This 1) is shorter 2) expresses intention rather than implementation. -- https://bugs.ruby-lang.org/ Unsubscribe: