On Fri, 6 Oct 2000, Yukihiro Matsumoto wrote:

> |Say I have something similar to:
> |
> |class Super
> |  def m
> |    print "Super#m\n"
> |  end
> |end
> |
> |class Sub < Super
> |  def m
> |    super
> |    print "Sub#m\n"
> |  end
> |end
> |
> |s = Sub.new
> |
> |and want to redefine Super#m (as a singelton method?) in s. Is it
> |possible?
> 
> class Super
>   def m
>     print "Super#m\n"
>   end
> end
> 
> class Sub < Super
>   def m
>     super
>     print "Sub#m\n"
>   end
> end
> 
> s = Sub.new
> 
> def s.m
>   super
>   print "s.m\n"
> end
> s.m
> 
# -> "Super#m\nSub#m\ns.m\n"

But I want something like

# -> "Super#new_m\nSub#m\n"

Without having to redefine m in Super for all instances of Sub.

Sorry for not describing it better.

/Robert