From: Trans Date: 2007-11-14T20:49:25+09:00 Subject: Re: method_added/define_method infinite loop On Nov 13, 11:16 pm, "Chris Carter" wrote: > On Nov 13, 2007 8:24 AM, Trans wrote: > > > This will, of course, print "foo" forever. > > > As an aside, anyone else think method_added should also receive a > > block of the method definition? E.g. this would be a "push" (less the > > infinite loop issue): > > > def self.method_added(name, &block) > > define_method(name, &block) > > end > > I might be missing something, but I cannot think of a practical use > for that. It re-defined the method with the same name and > content....Why? I'm impractical ? ;) meta-programming. In this instance, I was working on a Traits idea. I need to rename every method defined and keep track of it and replace it with a method that weaves together these renamed methods. T.