Project

General

Profile

Feature #10489

Add inherit method for clearer and multiple inheritance

Added by brauliobo (BrĂ¡ulio Bhavamitra) about 3 years ago. Updated almost 3 years ago.

Status:
Open
Priority:
Normal
Target version:
[ruby-core:66150]

Description

A new and more intuitive syntax:

class B
end
class A
  inherit B
end

Instead of (but keeping this for backwards compatibility):

class B
end
class A < B
end

Besides, this allows multiple inheritance. Also, inherit could be implemented with just extend plus include?

History

#1 [ruby-core:66434] Updated by xiewenwei (xie wenwei) almost 3 years ago

BrĂ¡ulio Bhavamitra wrote:

A new and more intuitive syntax:

class B
end
class A
  inherit B
end

Instead of (but keeping this for backwards compatibility):

class B
end
class A < B
end

Besides, this allows multiple inheritance. Also, inherit could be implemented with just extend plus include?

Module is "multiple inheritance" for ruby. I don't think it is a good idea.

Also available in: Atom PDF