C
Christoph
gabriele said:I disagree, thinking that mixins and multiple inheritance are not the
same thing, and should not be pointed as such.
I tend to agree with Mathieu that the semantically insistence that
Ruby's mixins
are NOT some kind of MI of presents itself as a language game to
apiece the java kraut. On the other hand Ruby’s "Module mixin" relation is
NOT transitive, making it strikingly different from (single or multiple)
inheritance (see for example [ruby-talk:32007])
Is'nt it Class#new ?
Mathieu might be nominally wrong, but he is right in pointing out that
the current distinction between
"meta Object" (the singleton class of the "Class" object "Object") and
the class "Class" is just an artifact
of the current implementation of Ruby’s Object model. Two or three years
ago I even cooked up a
semi working modification of the interpreter (translation: the resulting
interpreter finished without crashing
running a couple of simple scripts), such that "meta Object" == Class
was true.
The strongest argument against "meta Object" == Class are the current
class relations
Class < Module < Oject.
To resolve this we could subclass both Module and Class from Object
directly, or settle on relations
Module < Class < Object
Another possibility, would be getting rid of the class Module
altogether, by either relying on full-blown MI
or restricting the mixins to special "Module classes". Any of these
alternative schemes have their shortcomings,
but the current Class < Module < Object isn't flawless either.
/Christoph