On 13/12/2011, at 11:10 PM, Mark Ryall wrote:
> This seems less intuitive:
> …
> Foo.ancestors => [Foo, Bar, Baz, Object, Kernel, BasicObject]
> Foo.new.hello => "hello from bar"
> 
> So super seems to traverse a stack of ancestors - there's no precedence given 
> to inheritance vs mixins (the implementation probably doesn't discriminate).

Method search doesn't discriminate, but it's important that mixins have 
precedence over inheritance.
A lot of common idioms simply wouldn't work without that. Bear in mind that 
ancestor classes might
have mixins too. Where would they go if not before ancestors?

Clifford Heath.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en.

Reply via email to