From: "x3qt (Jury Paliakou) via ruby-core" Date: 2023-09-22T15:07:15+00:00 Subject: [ruby-core:114881] [Ruby master Feature#19898] Special syntax for instance variable assignment 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/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/