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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Poor ascii art follows, but I found it helpful to map this out a little bit (pls /msg me if the formatting appears munged):

/ scope ----- / "outside" the entity/ | abstraction | "inside" the entity/ encapsulation | barrier | encapsulation | | identifier/ binding => | | name reference => | =======> | => value/summary \ \ /scope -----

Scope is created by the abstraction barrier insofar as variables and functions defined within the entity itself are inaccessible without, i.e., a lexical variable within a subroutine is accessible only within that subroutine, not to the caller or to other subroutines called from within that unit of encapsulation.

An identifier or name is bound insofar as it merely points to an entity, whereas a name refers if it points across the abstraction barrier to a specific value or summary of the entity.

To dereference is to pull a value or summary across the abstraction barrier to access it directly (or step across the barrier to it, which I guess is an equivalent metaphor), so  my $array_ref = [qw/foo bar/] puts the array itself safely behind the barrier, making $array_ref[0] a violation of encapsulation. Instead, we must say $array_ref->[0] to cross the boundary. Actually, now that I think about this, talking about Perl references muddies the water, doesn't it? Rather, we just mean the use of any variable which results in a taking-hold of the value referenced. So, a better example might just be ordinary string interpolation.

I suppose that means then that a closure is a way of exposing a scoped variable without bringing it across the abstraction barrier.

I'm still confused about what a summary/value is though. Could you provide a concrete example? Also, does object permanence mean "the same entity" in terms of memory location or content? From the discussion, I'm thinking it's the latter. Or maybe that's just the difference between the entity and it's summary?

In any case, great write up; IMHO the best so far!


In reply to Re: MOPT-03 - identification, part 1 by djantzen
in thread MOPT-03 - identification, part 1 by mstone

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 examining the Monastery: (5)
As of 2024-04-19 07:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found