
22 Sep
2023
22 Sep
'23
3:07 p.m.
Issue #19898 has been reported by x3qt (Jury Paliakou). ---------------------------------------- Feature #19898: Special syntax for instance variable assignment https://bugs.ruby-lang.org/issues/19898 * Author: x3qt (Jury Paliakou) * Status: Open * Priority: Normal ---------------------------------------- Since keyword arg assignment is already DRY with omitting of argument of the same name, what about DRYing out an instance var assignment? Something like this, with "@" for example, since it's already used to assign instance vars / memoize ``` ruby def initialize(payload) @payload = payload end def abc(d) @d = d end # to be have a short from of def initialize(@payload) end def abc(@d) end ``` -- https://bugs.ruby-lang.org/