From: Jason Voegele Date: 2002-04-03T05:16:59+09:00 Subject: RE: Mixins vs. Multiple Inheritance > A typical mixin module doesn't define a class. In C++ two > classes foo and bar might be fully defined, non-abstract > classes you use in your program. Later you may decide to use > foo and bar as bases for baz. > > Ruby mixins are different, they tend to define some functions > in terms of other functions found in the class they're mixed > into. They can be almost like base classes as they can define > instance variables that are injected into the class they're > mixed into (unless I misunderstand something here.) So how would the following scenario be any different if Foo and Bar were classes instead of modules? (presuming that Ruby had true multiple inheritance): module Foo def baz @baz end end module Bar def booz @booz end end class Foozboozer include Foo include Bar def initialize(baz, booz) @baz = baz; @booz = booz end end Thanks, Jason Voegele