Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Foo is not a Bar, why?

by Abigail-II (Bishop)
on Dec 18, 2003 at 21:13 UTC ( #315657=note: print w/ replies, xml ) Need Help??


in reply to Foo is not a Bar, why?

This is the same "problem" as:

print "The colour is ", colour (), "\n"; ... my $colour = "red"; sub colour {$colour}
And that has nothing to do with objects being bolted on.

Abigail


Comment on Re: Foo is not a Bar, why?
Download Code
Re: Re: Foo is not a Bar, why?
by hardburn (Abbot) on Dec 18, 2003 at 21:51 UTC

    The fact that inheirtance is done at all through a package variable is where the bolted-on part comes in. Perl just does too much OO stuff at runtime, which ends up being a very good Perl system but not a great OO system.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    : () { :|:& };:

    Note: All code is untested, unless otherwise stated

      You will never hear me saying Perl's OO system is anywhere near half decent. But the problem pointed out by liz isn't an OO specific problem - it can happen with non-OO code as well.

      Abigail

      Would you consider Smalltalk a "not great OO system"? It does even more at runtime.

      Also, if Perl 5 introduced both packages and objects, how could objects be "bolted on"? Packages exist, in part, to make objects possible, without requiring OO coding!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-12-23 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (135 votes), past polls