Niklas Frykholm wrote:


> On a general note though, shouldn't #upcase and #reverse return
> objects of the same type in this situation? It is kind of surprising
> that they don't. And to make subclassing easier, they should return
> objects of type HoX.
> 
> That is, I would want the following
> 
>     Transformation operations, such as upcase, reverse, etc, should
>     return an object of the same type as the original. (i.e. use
>     self.class.new instead of String.new).


Me too. Perhaps you want to consider posting an RCR? Or are we missing 
something?

Chaining string methods mixed with subclass methods would be easier to 
use if all String methods would return an object of the same type of the 
receiver.

Tobi

-- 
Tobias Reif
http://www.pinkjuice.com/myDigitalProfile.xhtml

go_to('www.ruby-lang.org').get(ruby).play.create.have_fun
http://www.pinkjuice.com/ruby/