Hi,

In message "Re: differences between Module and Class ?"
    on 03/08/21, Mathieu Bouchard <matju / sympatico.ca> writes:

|Here are the main consequences I've found to that change:
|
|1. Module==Class returns true, and so no longer Module<Class returns true.
|   Therefore, Module#include would work with Class arguments
|   and class A<x would work for any Module x.
|
|2a. Class.new is moved to Object#new. A Class that does not have Object in
|    its ancestor list does not inherit from Object#new and is thus
|    uninstantiable.
|  OR
|2b. Class.new stays where it is. Former Modules thus become instantiable
|    (though not necessarily meaningfully).

(2a) breaks inheritance tree.  It's not acceptable.

In summary, your point is the following, right?

|2. Pickaxe says "multiple inheritance [can be] dangerous, as the
|inheritance hierarchy can become ambiguous. [Mixins] provide a controlled
|multiple-inheritance-like capability with none of the drawbacks" (p.23).
|
|Pickaxe was the first printed English book on Ruby, which for me was an
|appropriate successor to ruby-man-1.4, and quite elegantly written.
|However the part I've cited above is, after close examination, a wild,
|bold opinion that I find very difficult to agree with.

I know mix-in is restricted MI as you state.  So the question is why
restrict where MI _can_ do it.

 * at the point of I designed Ruby, the concept of "mix-in" was not
   known widely.  So I wanted to advocate "mix-in" by prohibiting
   multiple inheritance, and making it a language feature.  I still
   feel the need for advertise.

 * you can (or forced to) distinguish is-a relation to has-a relation
   with "single inheritance w/ mix-in".  I believe this distinction is
   a good thing, which make relations clear.  I want to guide people
   by preparing set of features.

 * I love the model of single rooted class hierarchy, sharing
   attributes by modules.  But it's much simpler and easier to
   understand than class network of multiple inheritance.

For sure, there are some people finding mixing-in more difficult to
understand, specially among those who have no trouble with multiple
inheritance and prefer simpler feature set.  It's a matter of trade
off.  I had to choose between (a) simpler language w/ multiple
inheritance, (b) language which is bit more complex, but encourages
good usage of class-class relationship.  You are seeing the result of
my decision.

							matz.