The 'inheritance mechanism' is the -> operator,
No. The inheritance mechanism applies to method calls. Few of the -> operators have anything to do with methods. For example,
$x->[0]
Furthermore, not all method calls use the -> operator. For example,
new Foo
Forms of method calls:
$class->method(LIST) # Static method call.
$object->method(LIST) # Instance method call.
$x->Class::method(LIST) # Pretend the LHS is class "Class".
$x->SUPER::method(LIST) # Pretend the LHS is its super class.
method $x LIST; # Indirect method syntax
I think that's all of them.
Horse::speak("Horse") is a sub call. Subroutines aren't inherited. Subroutines don't have classes, so subroutines don't have parent classes, so subroutines have nothing from which they could inherit. |