From: Trans Date: 2013-01-19T00:24:14+09:00 Subject: [ruby-core:51507] Re: Autoload in pure Ruby --e89a8f234ec37df40b04d3919ad8 Content-Type: text/plain; charset=UTF-8 On Sun, Jan 13, 2013 at 7:53 AM, Trans wrote: > So, no one over at ruby-talk seems to be able to tell me why my > reimplementation of autoload doesn't quite work. Can anyone here perhaps > shed some light? > > https://github.com/rubyworks/autoload/blob/master/lib/autoload.rb > > > https://groups.google.com/forum/?fromgroups=#!topic/ruby-talk-google/RbYIfsIV--U > > Currently the error I get when running `bundle exec` is: > > bundler-1.2.3/lib/bundler/dsl.rb:128:in `initialize': > wrong number of arguments(1 for 0) (ArgumentError) > > I believe I figured it out. The problem is that autoloads are triggered on the first creation of a class or module via the literal `class Foo` or `module Foo` notation. Lacking any callbacks for this it is not possible to re-implement autoload in pure-Ruby. End of story. Well then, a big thanks for nothing! --e89a8f234ec37df40b04d3919ad8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On S= un, Jan 13, 2013 at 7:53 AM, Trans <transfire@gmail.com> w= rote:
So= , no one over at ruby-talk seems to be able to tell me why my reimplementat= ion of autoload doesn't quite work. Can anyone here perhaps shed some l= ight?

=C2=A0 https://github.com/rubyworks/autoload/blob/= master/lib/autoload.rb

=C2=A0 https://groups.google.com/= forum/?fromgroups=3D#!topic/ruby-talk-google/RbYIfsIV--U

C= urrently the error I get when running `bundle exec` is:

=C2=A0 bundler-1.2.3/lib/bundler/dsl.rb:128:in `initialize':
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 wrong number of arguments(1 for 0) (Argume= ntError)


I believe I figured it out. The problem is that autoloads are triggered= on the first creation of a class or module via the literal `class Foo` or = `module Foo` notation. Lacking any callbacks for this it is not possible to= re-implement autoload in pure-Ruby. End of story.

Well then, a big thanks for nothing!
<= /div>
--e89a8f234ec37df40b04d3919ad8--