On 7/18/06, Trans <transfire / gmail.com> wrote:
>
> On a side note I think I found a bug in Ruby, maybe
>
>   class X
>     def self.method_added(name)
>       p name
>     end
>   end
>
>   class X
>     def x; end
>    end
>    => :x
>
>   class << X
>     undef_method :method_added
>   end
>
>   class X
>     def y; end
>   end
>   => NoMethodError: undefined method `method_added' for X:Class
>
>
> </Trans>
>
>
Is it a bug? You are undef'ing it after all. remove_method would seem
more appropriate in this use case.

But maybe a warning like "undefining `method_added' may cause serious
problem" like for __send__, __id__, etc. might be in order.

Regards,
Sean