Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Instance and class variable assignment
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Daniel Schierbeck, post: 4488079"] I know this has been suggested before, but the only reason for rejection i found at the RCR archive was a dead end link... Can someone explain to me why this shouldn't be implemented in Ruby: def foo(@a, @b = "foo", @@c = "bar") # do something end # should do the same as this def foo(a, b = "foo", c = "bar") @a = a @b = b @@c = c # do something end I personally think it looks very interesting, especially since most initialize methods (at least most of those I write) just set instance and class variables. Cheers, Daniel [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Instance and class variable assignment
Top