D
Daniel Schierbeck
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
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