From: Christophe Grandsire Date: 2005-10-18T23:03:29+09:00 Subject: Re: Instance and class variable assignment Selon Daniel Schierbeck : > > Can someone explain to me why this shouldn't be implemented in Ruby: > > def foo(@a, @b = "foo", @@c = "bar") > # do something > end > My eyes!!! >*_*< > # 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. > I can see why you're interested (it shortens things quite a bit), but I think it's a wrong idea. It's confusing to have method arguments that are not method-local. Isn't that why the current behaviour of block arguments is going to be changed? :) -- Christophe Grandsire. http://rainbow.conlang.free.fr It takes a straight mind to create a twisted conlang.