On 10/10/05, Mathieu Bouchard <matju / artengine.ca> wrote:
> On Tue, 11 Oct 2005, TRANS wrote:
>
> >   module Q
> >     module H
> >       def x ; @x ||= [] ; end
> >     end
> >     extend H
> >   end
> >   class R
> >     extend Q::H
> >     def self.x ; @x ||= [] ; super + @x  ; end
> >     def self.x! ; @x ||= [] ; end
> >   end
>
> >   R.x! << 2
> >   => [2]
> >   R.x
> >   => [2, 2]  # huh?
>
> class<<R;self;end is a subclass of class<<Q::H;self;end, right?
>
> classes are objects like everything else. Calling super causes a
> supermethod to be called in class<<Q::H;self;end with self=R.

Ah, I see. So it's the same @x in either method --I thinking super
would behave the same as calling Q::H.x. Is this why super is "hard
bound" at compile time.

Thanks,
T.