Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: Teach him a lesson with facts

by adrianh (Chancellor)
on Feb 23, 2003 at 13:02 UTC ( #237886=note: print w/replies, xml ) Need Help??


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

But did you also know that adding OO to Perl required defining precisely zero new syntax to the language?

I'm in a niggly mood :-)

I don't know where this meme started - but it's not true. OO in perl needed little new syntax, but it did need -> method invocation, indirect object syntax and SUPER::.

Adding OO to perl was done very neatly, so neatly many people didn't notice the difference - but there is specific syntax too support OO in perl.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Teach him a lesson with facts
by hardburn (Abbot) on Feb 23, 2003 at 14:24 UTC

    I don't know where this meme started . . .

    Possibly on page 321 of the blue Camel, just under the "Class Inheritance" subheading:

    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.

    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::.

    ----
    Reinvent a rounder wheel.

    Note: All code is untested, unless otherwise stated

      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.

        ;-) Pure tech discussion.

        One problem with Perl OO is that it does not deliver everything OO requires in theory. That we all see it, and I saw you agreed.

        Another big problem I see with Perl OO is that, becasue of Perl OO is usually implemented as hash, and Perl hash takes lots of memory, this "bad" combination actually make things worse.

        I think something need to be done about this, before Perl's OO can be 100% accepted by me, actually not just me ...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://237886]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2018-11-21 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (237 votes). Check out past polls.

    Notices?