From: MenTaLguY Date: 2007-10-08T10:19:32+09:00 Subject: Re: The Case for Multiple-Inheritance --=-qJyQhYY0D03rJoQgjSiZ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2007-10-08 at 01:12 +0900, Pat Maddox wrote: > Here's something off the top of my head, that allows you to reason > about "types" without needing MI. >=20 > module LinuxApplication; end > module VideoApplication; end > module WindowsApplication; end >=20 > class LinuxVideoApplication > include LinuxApplication > include VideoApplication > end >=20 > class WindowsVideoApplication > include WindowsApplication > include VideoApplication > end >=20 > def only_linux_video_please(app) > raise "Must be a LinuxVideoApplication" unless LinuxApplication =3D=3D= =3D > app && VideoApplication =3D=3D=3D app > end I'm not sure this is a particularly good example; it's based off of Trans' example, not Sylvain's, and it also does use multiple inheritance inasmuch as modules amount to restricted MI. -mental --=-qJyQhYY0D03rJoQgjSiZ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD4DBQBHCYWjSuZBmZzm14ERAtLWAJjQDKkkPg/BZRo3wn7gxZsK+71PAJ9e8iar yQRQYeDfXG10JCasYiZh2w== =Pkv1 -----END PGP SIGNATURE----- --=-qJyQhYY0D03rJoQgjSiZ--