From: Xavier Noria Date: 2013-01-19T20:52:23+09:00 Subject: Re: Module including other module. --90e6ba613bb45548de04d3a2dc5e Content-Type: text/plain; charset=UTF-8 I asked about this to Matz in the past and it works that way basically as a consequence of the implementation. > > As you probably know, MRI stores a linear flat chain of ancestors of a class or module. Each ancestor has a pointer to its own direct ancestor in the chain of that particular class or module conceptually (there are indirections but they are not important). Thing is, albeit new methods are found because method name resolution follows the pointers at the time of the call (conceptually), and albeit if you include another module in the very class the pointers are adjusted, when you include a 2nd order module the ancestor chains of the classes or modules the enclosing module was already mixed in are not updated and reflattened so to speak. Indeed, modules just do not keep that information, they do not know where they have been included. So that update is not even possible with the current implementation. Matz said he would be willing to make this work provided the implementation had no performance penalty. Sent from my iPhone --90e6ba613bb45548de04d3a2dc5e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I asked about this to Matz in the past and it works that way basically as a= consequence of the implementation.

As you probably know, MRI stores=C2=A0a li= near flat chain of ancestors of a=C2=A0class or module. Each ancestor has a= pointer to its own direct ancestor in the chain of that particular class o= r module conceptually (there are indirections but they are not important).<= /div>

Thing is, albeit new methods are found because method n= ame resolution follows the pointers at the time of the call (conceptually),= and albeit if you include another module in the very class=C2=A0the pointe= rs are adjusted,=C2=A0when you include a 2nd order module the ancestor chai= ns of the classes or modules the enclosing module was already mixed in are = not updated and reflattened so to speak.

Indeed, modules just do not keep that information, they= do not know where they have been included. So that update is not even poss= ible with the current implementation.

Matz said he= would be=C2=A0willing to make this work provided the implementation had no= performance penalty.

Sent from my iPhone
--90e6ba613bb45548de04d3a2dc5e--