Project

General

Profile

Actions

Feature #10489

open

Add inherit method for clearer and multiple inheritance

Added by brauliobo (Bráulio Bhavamitra) over 6 years ago. Updated 5 months 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?

Updated by xiewenwei (xie wenwei) over 6 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.

Actions #2

Updated by naruse (Yui NARUSE) 5 months ago

  • Target version deleted (3.0)
Actions

Also available in: Atom PDF