in reply to Re: Inheritance via class::derived_method Question
in thread Inheritance via class::derived_method Question
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Inheritance via class::derived_method Question
by How09 (Novice) on Nov 20, 2010 at 06:26 UTC | |
by ikegami (Patriarch) on Nov 22, 2010 at 17:31 UTC |