From: Josh Cheek Date: 2013-07-24T22:34:42+09:00 Subject: Re: class <=> module --001a11c36682b19a9e04e241f89c Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jul 24, 2013 at 7:51 AM, wrote: > Am 24.07.2013 14:35, schrieb Josh Cheek: > >> On Wed, Jul 24, 2013 at 1:10 AM, > > wrote: >> >> >> And you forgot to mention: classes can inherit only from a single >> other >> class (a conscious decision by Matz), but you can include many >> modules. >> Seems difficult to unify that in one concept. >> >> >> That seems inaccurate to me: >> >> C1 = Class.new Object >> C2 = Class.new C1 >> C3 = Class.new C2 >> > > I was alluding to multiple inheritance, meaning a class > inherits _directly_ from more than one superclass. > > I still don't understand. I showed that you can inherit from multiple classes like you can inherit from multiple modules. Yes there are other differences, but this does not seem to be one of them. Perhaps you think that modules have some sort of fancier inheritance? If so, this is not the case. When you include a module, an anonymous class with the module's methods gets inserted as the superclass. --001a11c36682b19a9e04e241f89c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Wed, Jul 24, 2013 at 7:51 AM, <sto.mar@web.de> wrote:
Am 24.07.2013 14:35, schrieb Josh Cheek:
On Wed, Jul 24, 2013 at 1:10 AM, <sto.mar@web.de
<mailto:sto.mar@web.= de>> wrote:


=A0 =A0 And you forgot to mention: classes can inherit only from a single o= ther
=A0 =A0 class (a conscious decision by Matz), but you can include many modu= les.
=A0 =A0 Seems difficult to unify that in one concept.


That seems inaccurate to me:

C1 =3D Class.new Object
C2 =3D Class.new C1
C3 =3D Class.new C2

I was alluding to multiple inheritance, meaning a class
inherits _directly_ from more than one superclass.
=

I still don't understand. I = showed that you can inherit from multiple classes like you can inherit from= multiple modules. Yes there are other differences, but this does not seem = to be one of them. Perhaps you think that modules have some sort of fancier= inheritance? If so, this is not the case. When you include a module, an an= onymous class with the module's methods gets inserted as the superclass= .
--001a11c36682b19a9e04e241f89c--