From: Austin Ziegler Date: 2005-10-18T23:54:29+09:00 Subject: Re: Instance and class variable assignment On 10/18/05, Daniel Schierbeck wrote: > Austin Ziegler wrote: >>> 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 >> Yes. Matz doesn't like it. ;) (And I agree with Christophe -- my >> eyes! ;) > Bollocks :( It's a bit of an oversimplification to simply say that Matz doesn't like, but I do understand why. It isn't exactly intuitive to set instance variables in a method signature. (I'm not invoking POLS here, I'm suggesting instead that it would be unnecessarily confusing.) That said, it might be nice to have a language construct like C++'s initialization list: class Person { Person() : name(""), age(-1) { // The rest of Person's default constructor here. } } -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca