in reply to Re: Re: Re: Re: Re: Re: Teach him a lesson with facts
in thread Teach him a lesson with facts

As with the rest of Perl's object system, inheritance of one class by another requires no special syntax to be added to the language.

Inheritance didn't need extra syntax (it's just assigning to @ISA). Method invocation did.

The -> operator denotes a referance, which has plenty of use outside OO. In this case, were referancing a subroutine from a bless'd variable. I'm not sure about SUPER::.

Well, since references and OO came along in the same release you could argue that the syntax needed to be added for OO ;-)

While the lexical item "->" is the same, the syntax for $object->method is different from $arrayref->[...], $hashref->{...}, etc. It needed to be added for OO (just as we got $coderef->(...) syntax added in 5.003_98 - as the result of a bet I seem to recall)

While something like indirect object syntax was around in perl4 (witness print FILEHANDLE) I think it disingenuous to call it the same syntax as method $object and method Package - hacking of the parser was necessary.