Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Foo is not a Bar, why?

by chromatic (Archbishop)
on Dec 18, 2003 at 17:32 UTC ( #315579=note: print w/ replies, xml ) Need Help??


in reply to Foo is not a Bar, why?

I'm not sure your moral is fair. Would you conclude that variables are bolted onto Perl 5 after running the following code?

print $Foo::x; package Foo; $x = "Hello";


Comment on Re: Foo is not a Bar, why?
Download Code
Re: Re: Foo is not a Bar, why?
by liz (Monsignor) on Dec 18, 2003 at 18:23 UTC
    No, but the fact that you have to use package globals to indicate inheritance, does indicate to me that inheritance was added later.

    Now, if Perl had a syntax such as:

    package Foo isa Bar;
    I betcha I wouldn't have had this problem. ;-)

    Liz

      No, but the fact that you have to use package globals to indicate inheritance, does indicate to me that inheritance was added later.

      But... Everything was added later. Have you tried Perl 1.0? Almost everything we use now was bolted on later. And I'm glad it was.

      Also, I'm glad they did this with a package global. Being able to change @ISA later has come in handy more than once for me.

      Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

        Also, I'm glad they did this with a package global. Being able to change @ISA later has come in handy more than once for me.

        Not using package globals to indicate inheritance does not necessarily have to mean you wouldn't be able to change inheritance "on the fly".

        It's just that it's exposed to the outside world as a package global. It's like a car with the gear box on the outside. It sure will work, and you may even be able to switch gears even when you're not sitting in the car. But it still is an ugly sight!

        A sight that I've come to love, though, let there be no mistake about that!

        Liz

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-12-25 02:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (159 votes), past polls