From: Robert Klemme Date: 2008-09-26T03:31:24+09:00 Subject: Re: Getting the right class with inheritance and super() 2008/9/25 Kyle Schmitt : > Reading the example you gave, and even some on the net, it looks like > I'd need the Array class to have a coerce method that can change an > Array into a FixedSizeArray? No. Your coerce method needs to take care. Look at my example. I did not change Fixnum or Float. > On Thu, Sep 25, 2008 at 9:51 AM, Robert Klemme > wrote: >> If you think about it for a moment you'll realize that your >> FixesSizedArray is far from usable in every place where an Array is >> used. Just think about algorithms that rely on collecting arbitrary >> many objects in an Array (e.g. File.readlines) - you cannot use your >> FixedSizedArray there. > > I agree that it can't be used everywhere, but where I want to use it, > I want it to look and feel very much like an array. That's ok but that does not mean that a FixedSizedArray *is an* Array. I was talking about semantics of inheritance which is usually denoted *is a* relationship. Cheers robert -- use.inject do |as, often| as.you_can - without end