From: "David A. Black" Date: 2005-01-18T02:11:49+09:00 Subject: Re: Fwd: [suby-ruby] Your all time desired fundamental Ruby mod Hi -- On Tue, 18 Jan 2005, trans. (T. Onoma) wrote: > On Monday 17 January 2005 11:19 am, David A. Black wrote: > > | It strikes me as a perfectly idiomatic way of writing a "getter" > | method with a default value. I call it "polite" because it sets up a > | situation where what will happen is that the object will be sent a > | message and handle it. > > But its not just idiomatic, its functional. For instance what if nil is a > valid value. But worse every time you read the value via the getter you are > also potentially calling a setter too. Its not a complete substitute for > initializing the instance var. Also problems can arise in meta-programming > when one does use instance_variable_get. > > | How would you have done it? > > There really needs to be a way to guarantee an initialization at each level of > the class hierarchy. I think we have to agree on a parting of the ways on this at this point :-) David -- David A. Black dblack@wobblini.net