From: jweirich@... Date: 2001-08-06T19:59:57+09:00 Subject: [ruby-talk:19205] Re: Some remarks from a nembie in Ruby >>>>> "Niklas" == Niklas Frykholm writes: >> 6) I like the multiple affectation very much! But by default it drops >> silently non-affected values, I find this quite dangerous. >> I would prefer the following usage: >> a,b = 1,2,3 --> Warning (or maybe error?). >> a,b,.. = 1,2,3 --> dropping silently the 3. (The ",.." is just an >> example here.) Niklas> Agreed. Warning or error should be given at compile time. This can't always be detected at compile time. E.g. a,b = some_array >> 16) If I understand well, mix-in are used to do the same thing as the >> multiple inheritance, why not use the same multiple inheritance >> scheme as Eiffel ? It seems simpler to me. Niklas> I'm not sure how Eiffel does multiple inheritance. How Niklas> does it deal with the problems of name collisions and Niklas> cycles in the inheritance graph? Yes, Eiffel handles name collisions, mainly through renaming. Cycles aren't allowed in an inheritance graph, but you are probably refering to repeated inheritance (where an ancestor class is inherited from more than one direct parent class). Eiffel allows repeated inheritance, and will normally merge the repeated ancestor class into a single instance. The Eiffel inheritance scheme is pretty tied to the static declaration of the classes. I'm not sure how well it would work in a dynamic language like Ruby. OTOH, I agree that the current mixin style is 90% of full multiple inheritance. It would be theorically nice to have full MI, but the current scheme is quite practical and useful. -- -- Jim Weirich jweirich@one.net http://w3.one.net/~jweirich --------------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)