--- Austin Ziegler <halostatue / gmail.com> wrote:

> On 8/19/05, Eric Mahurin <eric_mahurin / yahoo.com> wrote:
> > Fixnum#<most methods>
> > String#<most methods>
> > Object#<most methods>
> 
> I disagree on all three. In no way do I believe that such
> overriding
> is problematic, and I would never trade this flexbility for
> an attempt
> at speed. Some methods, perhaps, but only those that fit the
> /\b__[\w\d]+__\b/ pattern and are defined in the core. That's
> a lot
> fewer than you're suggesting.

You pulled this list out of context.  I'm talking about
redefining methods directly in the class, not overriding in a
derived class.  I think you should be able to override just
about anything (except a few things in Object).  Of course you
can override anything in the immediate classes because you
can't make derived classes of them.

Seems like I've seen somewhere referring to Matz discouraging
redefining core class methods.

Do you seriously believe that it really makes sense to redefine
something like Fixnum#+ ?  When you do that, you are only
affecting the ruby code using Fixnum's, because in typical C
code they have already bypassed the method call altogether and
effectively inlined the method.  You'll end up with something
strangely inconsistent.



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com