<html>

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">


<meta name=Generator content="Microsoft Word 10 (filtered)">

<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle19
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>In GemStone/Smalltalk rather than having a
single SymbolDictionary (Smalltalk) that contains all the globals, there is a
list of SymbolDictionary instances each of which is examined to see if it has
the key being referenced. There is no built-in support for nesting&#8212;just an
Array of SymbolDictionary instances instead of a single SymbolDictionary instance.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The code:</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myTest
:= TestCase new.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Is equivalent to:</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myTest
:= (System myUserProfile symboList resolveSymbol: #&#8217;TestCase&#8217;) value
new.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>By convention, each SymbolDictionary
instance is contained in itself as a value where the key is its &#8220;name.&#8221;
For example, filing in the SUnit package results in creation of a new SymbolDictionary
whose initial key is #&#8217;SUnit&#8217; with the new SymbolDictionary instance
as its value. The new SymbolDictionary instance is added as the first entry in
the current SymbolList instance (so that any other globals with identical names
are effectively hidden), and then the file-in proceeds adding various keys
including #&#8217;TestCase&#8217;, #&#8217;TestResource&#8217;, #&#8217;TestResult&#8217;,
and #&#8217;TestSuite&#8217; (each of which has an associated value that is the
named class). </span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>If I wanted to be more particular about
the lookup in the above code example, I could specify:</span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>myTest := (SUnit at: #&#8217;TestCase&#8217;)
new.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Or, to be more specific:</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myTest
:= ((System myUserProfile symboList at: 2) at: #&#8217;TestCase&#8217;) new.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Or, to be more specific still:</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; myTest
:= (((AllUsers userWithId: &#8216;JamesFoster&#8217;) symbolList at: 2) at: #&#8217;TestCase&#8217;)
new.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Importantly, there is no change in the
language syntax. The &#8220;magic&#8221; happens during method compilation
where one of the arguments to the compiler is the SymbolList instance that is
to be searched for any needed global references. Different methods can be compiled
with reference to different SymbolList instances, and still call each other. This
allows for private classes, class replacement, etc. It has served reasonably
well for a couple decades.</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>James Foster</span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> Michael van der Gulik
[mailto:mikevdg@gmail.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> </span></font><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Wednesday,
 November 29, 2006</span></font><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'> </span></font><font
 size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>8:52 PM</span></font><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'><br>
<b><span style='font-weight:bold'>To:</span></b> james@foster.net; The
general-purpose Squeak developers list<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: Squeak and Namespaces</span></font></p>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

<p class=MsoNormal style='margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;</span></font></p>

<div>

<p class=MsoNormal style='margin-left:.5in'><span class=gmailquote><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>On </span></font></span><span class=gmailquote>11/30/06</span><span class=gmailquote>, <b><span style='font-weight:
bold'>James Foster</span></b> &lt;<a href="mailto:james@foster.net">james@foster.net</a>&gt;
wrote:</span></p>

<div link=blue vlink=blue>

<div>

<p style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>Michael's description is
something like what GemStone/Smalltalk provides&#8212;each login is assigned an
array of SymbolDictionary instances (a SymbolList), and compiling is in the
context of a SymbolList. You can have multiple globals visible with the same
name, but the first one found is used. Different code can be compiled with
different instances of SymbolList, and multiple instances of SymbolList can
reference the same SymbolDictionary. Security can be addressed by giving a user
a SymbolList that does not reference things that should be hidden.</span></font></p>

</div>

</div>

<div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><br>
That sounds interesting. <br>
<br>
- How do you specify that. rather than the first global found, you want to use
a different global with the same name? <br>
<br>
- Can SymbolDictionaries be nested? I.e.
Collections::Sequenceable::OrderedCollection?<br>
<br>
Michael.</span></font></p>

</div>

<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'>&nbsp;</span></font></p>

</div>

</div>

</body>

</html>