From: Ken Bloom Date: 2008-12-06T01:02:17+09:00 Subject: [ruby-core:20377] Re: Behavior: autoload calls rb_require() directly On Fri, 05 Dec 2008 03:25:42 +0900, Charles Oliver Nutter wrote: > Yukihiro Matsumoto wrote: >> I mentioned about fragility just because that will be an issue for Ruby >> 2.0. For MRI replacing core methods affect less, just because core >> functionality is done by C functions. But implantation like Rubinius >> suffers more. I think we will soon need to start discussing >> separating/protecting core implementation from user code by some kind >> of namespaces or packages. > > I agree. There's no practical reason anyone should be able to override > Fixnum#+, after all, and protecting the core simplifies implementation > and optimization too. > > - Charlie There's plenty of reasons why someone might want to override Fixnum#+. First: mathn.rb overrides Fixnum#/, and that's in the standard library Second: many people had the same argument that there was no practical reason to override the != operator separately from the == operator. It's something I wanted to do for DSL support (specifically, turning a block into an s-expression and then from there into SQL). Thankfully, this reasoning won out in Ruby 1.9 where I can now override != and !. (As it happens, my sexp19.rb does override Fixnum#/ for just this reason.) -- Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/