From: Paul Brannan Date: 2003-12-04T02:44:14+09:00 Subject: Re: mixin vs. multiple inheritence On Thu, Dec 04, 2003 at 02:37:06AM +0900, Robert Klemme wrote: > > You can build as complicated a mixin graph as you can a MI graph. The > > difference is that because mixins are modules, they don't have their > > own state, but instead parasitically use the state of the class into > > which they are mixed. > > U sure about that? Try this: > p X.new.instance_variables I think you misunderstood what Dave was saying. This prints [ "@foo", "@bar" ]. That's because the module and the class in which it is included share the same state, exactly as Dave pointed out. Paul