Trans
11/14/2007 11:49:00 AM
On Nov 13, 11:16 pm, "Chris Carter" <cdcar...@gmail.com> wrote:
> On Nov 13, 2007 8:24 AM, Trans <transf...@gmail.com> 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.