From: Pit Capitain Date: 2005-07-28T04:47:02+09:00 Subject: Re: What's so special about operators, built-in classes and modules? twifkak@comcast.net schrieb: >> Then you will have complex network of classes instead of simple >> tree structure, sharing code with modules. > > How does a complex network of classes differ from a complex network > of mixins? The main difference that I see is, as Ara pointed out, > #is_a?. But I could be missing something. I usually am. For me, the main difference between modules and classes is that classes "define" state (instance variables), not only behaviour (methods). One classic problem with multiple inheritence is the so called diamond: class A def initialize(val) @var = val end end class B include A def initialize super(5) end end class C include A def initialize super(42) end end class D include B include C end d = D.new Now, how many instances of A are in d? Two (one for B, one for C) or one? If one, what is the value of @var? You avoid such problems with mixins (modules). Regards, Pit