[#76442] [Ruby trunk Feature#11741] Migrate Ruby to Git from Subversion — naruse@...
Issue #11741 has been updated by Yui NARUSE.
3 messages
2016/07/19
[#76515] [Ruby trunk Bug#12610] webrick: protect from httpoxy — nagachika00@...
Issue #12610 has been updated by Tomoyuki Chikanaga.
3 messages
2016/07/22
[ruby-core:76434] [Ruby trunk Feature#12578][Feedback] Instance Variables Assigned In parameters ( ala Crystal? )
From:
matz@...
Date:
2016-07-19 08:33:53 UTC
List:
ruby-core #76434
Issue #12578 has been updated by Yukihiro Matsumoto.
Status changed from Open to Feedback
Arguments are giving names to passed values, which is different from attribute (instance variables) initialization. I think they should be separated clearly. And for most of the cases, only `initialize` needs this kind of initialization.
My idea is https://bugs.ruby-lang.org/issues/8563#note-3
Matz.
----------------------------------------
Feature #12578: Instance Variables Assigned In parameters ( ala Crystal? )
https://bugs.ruby-lang.org/issues/12578#change-59678
* Author: Matt Lankford
* Status: Feedback
* Priority: Normal
* Assignee:
----------------------------------------
When I first saw the instance assignments in Crystal, I was floored... I have looked at all 18 pages in this tracker and thought it "must" have been mentioned in here... but I don't see it... pardon me if I missed it...
BUT
so in Crystal, this :
```ruby
class MyStuff
def initialize @thing_one , @thing_two
end
end
```
would replace :
```ruby
class MyStuff
def initialize thing_one , thing_two
@thing_one = thing_one
@thing_two = thing_two
end
end
```
One of the things I loved about ruby was `attr_accessor` / `reader` / `writer`...
I know in Crystal, it is a macro, but still at the millions of lines of boilerplate that would go away...
Has no one thought of stealing this from Crystal or is there a good reason this does not exist? ( and I will go sit down and color now )
--
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>