From: Yukihiro Matsumoto Date: 2008-12-02T15:36:22+09:00 Subject: [ruby-core:20200] Re: Behavior: autoload calls rb_require() directly Hi, In message "Re: [ruby-core:20190] Behavior: autoload calls rb_require() directly" on Tue, 2 Dec 2008 02:54:36 +0900, Evan Phoenix writes: |While working on some specs, we found out that autoload |(Kernel#autoload and Module#autoload) internally call rb_require() |directly to pull the file in. This of course means that if |Kernel#require has been changed (for instance by rubygems) that the |changed logic won't be run. | |My question is if it's intentional that autoload bypasses |Kernel#require. If not, autoload should probably use rb_funcall() to |keep everything consistent. | |This obviously also effects Rubinius, as our autoload just calls |Kernel#require directly. This leads another question: should any implementation be affected by basic method replacement, which may make implementation fragile, but more extensible. For MRI, this is basically protected by calling C functions directly (no dynamic dispatch unless explicitly stated). But for Rubinius, it always use dynamic method calls by definition. The (official) spec will make this "implementation dependent". matz.