From: dblack@... Date: 2002-10-31T02:49:39+09:00 Subject: Re: method-call style (was Re: Snippet: Tiny Featureless Ruby Web Server) Hi -- On Thu, 31 Oct 2002, William Djaja Tjokroaminata wrote: > dblack@candle.superlink.net wrote: > > > I don't think one should make that assumption; it's awfully rigid. I > > might have: > > > def stuff=(x) > > @thing = x > > end > > > def stuff > > @thing > > end > > > which is a dinky example at best... but meaning there is no necessary > > connection between the methods and the implementation. > > Hi David, > > Well, it looks like a contrieved example, so it is really a matter of > personal style/convention. But now suppose that someone really writes a Yeah, I was worried I couldn't get away with that dinkiness :-) But still, I'm not convinced that "def stuff; @stuff; end" really deserves to be looked at as a special case. > code like above in a class, and I want to derive a new class from it, and > I need to access "the object logically represented by > stuff/thing". In my derived class, should I use "@thing" or should I use > "self.stuff"? Memories of a thread from a month or two ago... :-) I can't remember what the thread was called, but I don't think it reached a consensus. Some interesting things along the way, though. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav