From: sancozz@... Date: 2012-11-03T21:48:46+09:00 Subject: Re: Support for multiple Inheritance by classes --047d7b2edc0d4279de04cd96ac31 Content-Type: text/plain; charset=ISO-8859-1 unsubscrev please 2012/11/3 Arlen Cuss > I think I can say "no" with a fair amount of confidence. > > Single-inheritance is considered a good thing (and MI has many pitfalls), > too: http://www.artima.com/intv/tuesday2.html > > > On Saturday, 3 November 2012 at 6:21 PM, Ross Konsolebox wrote: > > > Will Ruby ever support multiple inheritance through classes instead of > > modules? This is good since it won't need modification of existing > > classes, and/or converting them to modules or class-module pairs before > > they are inherited by a new subclass with the use of include when we > > reuse them. > > > > class StableClassA > > puts :A > > end > > > > class StableClassB > > puts :B > > end > > > > class Inheritor < A, B # won't work > > puts :A > > puts :B > > end > > > > # To make things work: > > > > module StableModuleA > > puts :A > > end > > > > class StableClassA > > include StableModuleA > > end > > > > module StableModuleB > > puts :B > > end > > > > class StableClassB > > include StableModuleB > > end > > > > class Inheritor > > include StableModuleA > > include StableModuleB > > puts :I > > end > > > > -- > > Posted via http://www.ruby-forum.com/. > > > > > --047d7b2edc0d4279de04cd96ac31 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable unsubscrev please


2012/11/3 Arlen Cuss <ar@len.me>
I think I can say "no" with a fair amount of confidence.

Single-inheritance is considered a good thing (and MI has many pitfalls), t= oo: = http://www.artima.com/intv/tuesday2.html


On Saturday, 3 November 2012 at 6:21 PM, Ross Konsolebox wrote:

> Will Ruby ever support multiple inheritance through classes instead of=
> modules? This is good since it won't need modification of existing=
> classes, and/or converting them to modules or class-module pairs befor= e
> they are inherited by a new subclass with the use of include when we > reuse them.
>
> class StableClassA
> puts :A
> end
>
> class StableClassB
> puts :B
> end
>
> class Inheritor < A, B # won't work
> puts :A
> puts :B
> end
>
> # To make things work:
>
> module StableModuleA
> puts :A
> end
>
> class StableClassA
> include StableModuleA
> end
>
> module StableModuleB
> puts :B
> end
>
> class StableClassB
> include StableModuleB
> end
>
> class Inheritor
> include StableModuleA
> include StableModuleB
> puts :I
> end
>
> --
> Posted via ht= tp://www.ruby-forum.com/.





--047d7b2edc0d4279de04cd96ac31--