From: Jim Freeze Date: 2002-12-13T15:29:00+09:00 Subject: Re: Inheritance Question On Friday, 13 December 2002 at 15:24:08 +0900, Gavin Sinclair wrote: > From: "Jim Freeze" > > > > I like open classes, and use this feature for my own classes on occasions, > > but I am opposed in principle to modifying standard classes. Even > > though, one would still have problems since some of the methods you > > would expect to return self don't. Thus you cannot chain methods when > > you need to. > > > > I don't blame you for not wanting to modify "standard" classes, but in this > case I would consider Matrix to be a third-party class that happens to be > packaged with Ruby. It's hardly essential for Ruby's operation (like String, > Array, etc.). > Yes, but modifying it can cause alergic reactions in other third party libs that I or others using my code may include. It's a risk I don't want to take. > And if some of the methods can be plainly improved, I'd probably (for a simple > class like Matrix) modify them directly, prove the superiority over the > original with demonstrations in your code, and offer the improvements for > inclusion in the standard library. That way you'd be using the standard class > ahead of time! I have considered modifying the class directly. I'm not sure how successful I would be in getting my changes to ship with ruby. -- Jim Freeze ---------- Just because your doctor has a name for your condition doesn't mean he knows what it is.