[#83773] [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769 — usa@...
Issue #14108 has been updated by usa (Usaku NAKAMURA).
9 messages
2017/11/15
[#83774] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
usa@garbagecollect.jp wrote:
[#83775] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric
[#83779] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[#83781] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— "U.NAKAMURA" <usa@...>
2017/11/15
Hi, Eric,
[#83782] Re: [Ruby trunk Bug#14108] Seg Fault with MinGW on svn 60769
— Eric Wong <normalperson@...>
2017/11/15
"U.NAKAMURA" <usa@garbagecollect.jp> wrote:
[ruby-core:83942] [Ruby trunk Feature#8563] Instance variable arguments
From:
ko1@...
Date:
2017-11-29 06:25:19 UTC
List:
ruby-core #83942
Issue #8563 has been updated by ko1 (Koichi Sasada).
Not so serious idea.
```
class Binding
def set_attributes(attrs = self.local_variables)
attrs.each{|attr|
self.receiver.instance_variable_set(:"@#{attr}", self.local_variable_get(attr))
}
end
end
class C
def initialize a, b
binding.set_attributes
end
end
p C.new(1, 2) #=> #<C:0x000001f30a8b95d0 @a=1, @b=2>
```
----------------------------------------
Feature #8563: Instance variable arguments
https://bugs.ruby-lang.org/issues/8563#change-67999
* Author: sawa (Tsuyoshi Sawada)
* Status: Assigned
* Priority: Normal
* Assignee: matz (Yukihiro Matsumoto)
* Target version:
----------------------------------------
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:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>