[ruby-core:73529] [Ruby trunk - Feature #8563] Instance variable arguments

From: nobu@...
Date: 2016-01-27 09:47:38 UTC
List: ruby-core #73529
Issue #8563 has been updated by Nobuyoshi Nakada.

Description updated

----------------------------------------
Feature #8563: Instance variable arguments
https://bugs.ruby-lang.org/issues/8563#change-56743

* Author: Tsuyoshi Sawada
* Status: Assigned
* Priority: Normal
* Assignee: Yukihiro Matsumoto
----------------------------------------
Often times, people want to assign given arguments to instance variables, especially inside the method `initialize`:

~~~Ruby 
def initialize foo, bar, buz
  @foo, @bar, @buz = foo, bar, buz
  ...
end
~~~

I propose to let method definition take instance variables as arguments so that:

~~~Ruby 
def initialize @foo, @bar, @buz
  ...
end
~~~

would be equivalent as above.




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread