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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Just to bring the discussion right round, I thought I'd mention the textbook definition of an object: It is something that has identity, state, and behavior. That's all.

If you think of a behavior of the scalar as, for example, to place itself in the proper context depending on the operator operating on it (as it does in Perl), state as the value and other meta-attributes associated in the Perl guts with the scalar, and identity as, well, I'm kinda digging here, but the name of the scalar, then dragonchild is exactly right (and with a keen observation): A scalar is an object.

(I am but a lowly mathematician, so any CS folks out there who know better please pipe in if I am wrong. For reference, this definition of an object comes from "Object-Oriented Analysis and Design" by Grady Booch, 2nd Ed., p. 83.)

This observation is somewhat amusing to me in light of all of the discussion insofar as everyone seems to be debating whether Perl is OO or how OO Perl is. Perhaps one could argue that Perl is so very successfully OO that Perl programmers don't even know they're using objects?

Ah, the irony ;-)


In reply to Re: Why perl is more OO than C++ or Java... by Starky
in thread Why perl is more OO than C++ or Java... by dragonchild

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-25 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found