From: Trans Date: 2008-07-18T02:23:20+09:00 Subject: Re: Why is this cause an infinite loop? On Jul 17, 10:55 am, "Pit Capitain" wrote: > 2008/7/17 Trans : > > > Why is this cause an infinite loop? > > >  class X > >    def m; "m"; end > >  end > > >  class Y < X > >    def self.method_added(sym) > >        p sym > > >      alias_method("__#{sym}", sym) > >      remove_method(sym) > >    end > >  end > > >  class Y > >    def m; m; end > >  end > > >  Y.new.__m > > Tom, see above. Creating an alias triggers method_added. Dooh! Thanks, Pit. T.