<?xml version="1.0" encoding="windows-1252"?>
<node id="222467" title="Re: MOPT-03 - identification, part 1" created="2002-12-26 23:49:30" updated="2005-07-27 17:40:45">
<type id="11">
note</type>
<author id="131165">
djantzen</author>
<data>
<field name="doctext">
&lt;p&gt;
Poor ascii art follows, but I found it helpful to map this out a little bit (pls /msg me if the formatting appears munged):
&lt;code&gt;
									     / scope -----
										/
"outside" the entity/	| abstraction | "inside" the entity/
encapsulation			| barrier     | encapsulation
						 |             |
identifier/   binding =&gt; |	         |
name	    reference =&gt; |   =======&gt;  | =&gt; value/summary
					 				   \
					   				  \ /scope -----
&lt;/code&gt;
&lt;p&gt;
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.
&lt;p&gt;
An identifier or name is &lt;i&gt;bound&lt;/i&gt; insofar as it merely points to an entity,
whereas a name &lt;i&gt;refers&lt;/i&gt; if it points across the abstraction
barrier to a specific value or summary of the entity.
&lt;p&gt;
To &lt;i&gt;dereference&lt;/i&gt; 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 &lt;code&gt; my $array_ref = [qw/foo bar/] &lt;/code&gt; puts the array itself safely behind the barrier, making &lt;code&gt;$array_ref[0]&lt;/code&gt; a violation of encapsulation. 
Instead, we must say
&lt;code&gt;$array_ref-&gt;[0]&lt;/code&gt; 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 &lt;i&gt;any&lt;/i&gt; variable which results in a taking-hold of the value referenced. So, a better example might just be ordinary string interpolation.
&lt;p&gt;
I suppose that means then that a closure is a way of exposing a scoped 
variable without bringing it across the abstraction barrier.
&lt;p&gt;
I'm still confused about what a summary/value &lt;i&gt;is&lt;/i&gt; 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? 
&lt;p&gt;
In any case, great write up; IMHO the best so far!
&lt;p&gt;</field>
<field name="root_node">
222451</field>
<field name="parent_node">
222451</field>
</data>
</node>
