From: "Aleksi Niemelä" Date: 2000-07-12T15:20:04+02:00 Subject: [ruby-talk:03950] Multiple single inheritance? When I was wrestling with module definitions and 'inclusions' I couldn't come up with a reason why we don't have multiple single inheritance (and thus quite close to problem free (?) multiple inheritance). class Foo def foo puts "foo" end def bar puts "there's no bar in foo" end end class Bar def bar puts "bar" end end class FooBar < Foo, Bar def foobar puts "foobar" end end It would work like: class FooBar include_class 'Foo' # definitions, class variables, locals, include_class 'Bar' # whatever should be imported ... end The example would work as follows (with additional definition for BarFoo): class BarFoo < Bar, Foo end Foo.new.foo # => "foo" Foo.new.bar # => "there's no bar in foo" Bar.new.bar # => "bar" FooBar.new.foobar #=> "foobar" FooBar.new.foo #=> "foo" from Foo#foo FooBar.new.bar #=> "bar" from Bar#bar BarFoo.new.foo #=> "foo" from Foo#foo BarFoo.new.bar #=> "there's no bar in foo" # from Foo#bar The implementation wouldn't (?) be hard thing to do. The model would be same as with handling modules. Dead idea? - Aleksi