ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:114881] [Ruby master Feature#19898] Special syntax for instance variable assignment
@ 2023-09-22 15:07 x3qt (Jury Paliakou) via ruby-core
  0 siblings, 0 replies; only message in thread
From: x3qt (Jury Paliakou) via ruby-core @ 2023-09-22 15:07 UTC (permalink / raw
  To: ruby-core; +Cc: x3qt (Jury Paliakou)

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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-22 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-22 15:07 [ruby-core:114881] [Ruby master Feature#19898] Special syntax for instance variable assignment x3qt (Jury Paliakou) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).