From: Rick DeNatale Date: 2007-10-10T06:00:25+09:00 Subject: Re: Simple metaclass question On 10/9/07, MenTaLguY wrote: > On Wed, 10 Oct 2007 04:46:37 +0900, bob zee wrote: > > Why last k.hello is "Hello from Klass" Not "Hello from Mod"? After > > Klass mixin with Mod, I am extending k object to include Mod so k's > > metaclass methods now point to Mod methods.. right? they should get > > called first before Klass instance methods if I am thinking right. > > Ruby inheritance is linearized so that each module only appears once. > Since Mod is already present in k's class ancestry, adding it again > has no effect. For a while, about a year ago, Ruby 1.9 had changed the semantics of re-inclusion: http://talklikeaduck.denhaven2.com/articles/2006/10/09/a-subtle-change-to-mixin-semantics-in-ruby-1-9 But as far as I know it's now back to the 1.8 definition. I still don't understand why since it seems unnatural to me. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/