HI --

On Tue, 10 Jul 2007, Charles Oliver Nutter wrote:

> This seems very wrong to me. Calling through a method object should
> behave the same for super as calling directly or calling through an alias:
>
>
> class Foo
>  def a; puts 'Foo a'; end
>  def b; puts 'Foo b'; end
> end
>
> class Bar < Foo
>  def a; puts 'Bar a'; super; end
>  alias b a
> end
>
> Bar.new.a # => "Bar a\nFoo a"
> Bar.new.b # => "Bar a\nFoo a"
> Bar.new.method(:b).call # => "Bar a\nFoo b"
>
>
> It seems incorrect for method objects to change the behavior of super.
> If I super in 'a', I want super's 'a' to be called, without exception.

I agree that it's very odd that the two ways of calling behave
differently.  A secondary question is whether the #method behavior --
the dynamic calculation of what method super should look for -- has
any useful application.  I can't think of any.  Maybe we need "super!"
:-)


David

-- 
* Books:
   RAILS ROUTING (new! http://www.awprofessional.com/title/0321509242)
   RUBY FOR RAILS (http://www.manning.com/black)
* Ruby/Rails training
     & consulting:  Ruby Power and Light, LLC (http://www.rubypal.com)