Re: Operator Overloading <<
- From: Eric Mahurin <eric_mahurin@xxxxxxxxx>
- Date: Fri, 30 Sep 2005 23:22:09 +0900
--- Austin Ziegler <halostatue@xxxxxxxxx> wrote:
> Sorry, but this really doesn't have anything to do with my
> statement.
> One shouldn't inherit from Array, String, and Hash in Ruby
> because there
> are certain things that Don't Work the way that you'd expect
> them to
> because they are written in the C side.
In addition to this, I'd also say be very careful about
redefining methods in core classes. Same reason - they are
written in C. Many times the C code bypasses the standard
method call mechanism and calls other C code methods directly
so if you redefine you may not get what you want. An extreme
example is Regexp#=~. See what happens when you try to
override it - you'll get inconsistent results even if only ruby
code calls it.
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
.
- Prev by Date: Re: ruby gsub! problem
- Next by Date: Re: In your opinion....
- Previous by thread: Re: Operator Overloading <<
- Next by thread: Re: IBM vs. Microsoft vs. ... Ruby?
- Index(es):
Relevant Pages
|