From: Christoph Date: 2002-09-20T18:42:45+09:00 Subject: Re: Is better to subclass or to add methods to an existing class? "ts" wrote .... > C> I would bet on an A object. This behavior is somewhat problematic > C> (see the old "Subrange of String subclass" thread) but I don't see > C> this as a problem of overloading. > > If you add overloading, you add implicitely a new rule : to resolve a call > ruby compare 2 classes and select the *best* choice. I was not writing about my own preferences, just expectations, (I strongly prefer ``Array'' btw.) based on the imo wrong headed type mutating behavior (no Ruby in side at the moment) p A.new.sort, A.flatten, .... # A, A, ... > > This is not the choice made by ruby in my example because its result is > Array > > In short : > * you have removed coercion not a big loss;-) > * you change one rule of ruby I guess, adding overloading would be a much bigger change ... > > It's time, for you, to find a name for this new language (try to avoid P > for the first letter :-)) How, about Muby;-) > /Christoph