<br><br><div class="gmail_quote">On Thu, May 20, 2010 at 9:43 AM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Igor,<br><br><div class="gmail_quote"><div><div></div><div class="h5">On Thu, May 20, 2010 at 2:47 AM, Igor Stasenko <span dir="ltr">&lt;<a href="mailto:siguctua@gmail.com" target="_blank">siguctua@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
i just thought, that in order to get down to a minimal kernel image,<br>
it would be nice to move all Morphic globals into a shared pool.<br>
<br>
Things like, World, ActiveWorld<br>
could be placed into a MorphicPool class.<br>
<br>
Then we can make an easy transition<br>
1. add this pool to classes which using that global &amp; recompile them<br>
<br>
2. for classes, which should have no dependency from Morphic,<br>
use a messages like<br>
<br>
Object &gt;&gt; currentWorld<br>
   ^ (Smalltalk at: #MorphicPool ifAbsent: [ self error: &#39;bummer&#39; ])<br>
currentWorld .<br>
<br>
Then, i hope, you can unload the Morphic using MC and it will leave no<br>
trace in an image (or at least less trace than usual ;).<br>
<br>
Same could be applied to Graphics package (to get rid a Display global)<br></blockquote><div><br></div></div></div><div>Good idea.  This is a little like a poor man&#39;s namespaces.  It suggests the following cheap hack namespaces:</div>

<div><br></div><div>Inside Smalltalk all the Morphic class names are #&#39;Morphic.Morph&#39;  #&#39;Morphic.TheWorldMenu&#39; etc.  Inside the MorphicNamespace shared pool they are #Morph #TheWorldMenu etc.  The bindings for these would have to be shared between Smalltalk and the MorphicNamespace shared pool.  I guess something like a smart subclass of VariableBinding that when decompiling printed itself differently depending on whether its home pool was in scope or not might make the sleight-of-hand invisible.  You&#39;d also need to hack the browsers to prune the Morphic. prefix when the selected category began with Morphic.  Is this a primrose path, a slippery slope or a worth-while experiment?</div>
</div></blockquote><div><br></div><div>Provided that one can parse e.g.</div><div><br></div><div><div>Object subclass: #&#39;MorphicNamespace.Morph&#39;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>instanceVariableNames: &#39;bounds owner submorphs fullBounds color extension&#39;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>classVariableNames: &#39;EmptyArray&#39;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>poolDictionaries: &#39;&#39;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>category: &#39;Morphic-Kernel&#39;</div>
<div><br></div><div>then creating a namespace&#39;s shared pool and adding a class/global to the right namespace shared pool might be able to be done entirely in SystemDictionary&gt;&gt;at:put:</div><div><br></div><div><div>
at: aKey put: anObject </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>&quot;Override from Dictionary to check Undeclared and fix up</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>references to undeclared variables.&quot;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>| index element |</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>(self includesKey: aKey) ifFalse: </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>[self declare: aKey from: Undeclared.</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>self flushClassNameCache].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>super at: aKey put: anObject.</div><div>&gt;&gt;<span class="Apple-tab-span" style="white-space: pre; ">        </span>self checkForAdditionOfNamespaceKey: aKey.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>^ anObject</div><div><br></div><div>checkForAdditionOfNamespaceKey: aKey</div><span class="Apple-style-span" style="white-space: pre; ">        | namespaceName |</span><div>
<span class="Apple-tab-span" style="white-space: pre; ">        </span>(aKey includes: $.) ifFalse: [^self].</div><span class="Apple-style-span" style="white-space: pre; ">        (namespaceName := aKey copyUpTo: $.) isEmpty ifTrue:</span></div>
<div><span class="Apple-style-span" style="white-space: pre; ">                [self error: &#39;invalid namespace name&#39;].</span><div><span class="Apple-tab-span" style="white-space: pre; ">        </span><span class="Apple-style-span" style="white-space: pre; ">namespaceName := namespaceName asSymbol.</span></div>
<span class="Apple-tab-span" style="white-space: pre; ">        </span>namespace := (self at: <span class="Apple-style-span" style="white-space: pre; ">namespaceName ifAbsent: [])</span></div><div><span class="Apple-style-span" style="white-space: pre; ">                                        ifNil: [self at: namespaceName put: SharedPool new]</span></div>
<div><span class="Apple-style-span" style="white-space: pre; ">                                        ifNotNil: [:maybeSharedPool|</span></div><div><span class="Apple-style-span" style="white-space: pre; ">                                                maybeSharedPool isSharedPool ifFalse:</span></div>
<div><span class="Apple-style-span" style="white-space: pre;">                                                        [self error: &#39;namespace name refers to non-namespace&#39;].</span></div><div><span class="Apple-style-span" style="white-space: pre;">                                                maybeSharedPool].</span></div>
<div><span class="Apple-style-span" style="white-space: pre;">        namespace adoptBinding: (self bindingFor: aKey)</span></div><div><span class="Apple-style-span" style="white-space: pre;"><br></span></div><div><span class="Apple-style-span" style="white-space: pre;">or some such.  Removal in removeKey:ifAbsent:.</span></div>
<div><div><span class="Apple-style-span" style="white-space: pre;"><br></span></div></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote">

<div><br></div><div>best</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<font color="#888888"><br>
--<div class="im"><br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</div></font></blockquote></div><br>
</blockquote></div><br>