[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Is better to subclass or to add methods to an existing class?
From:       "Christoph" <chr_news () gmx ! net>
Date:       2002-09-20 9:42:45
[Download RAW message or body]

"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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic