<div dir="ltr">Hi folks,<div><br></div><div>I&#39;ve just uploaded to the Inbox a series of packages that implement a new way of handling export and import of bindings between packages. The protocol for working with environments remains the same, but internally, it&#39;s quite different. </div>
<div><br></div><div>The idea here is to make imports eager, rather than lazy. Instead of the &quot;references&quot; dictionary, which was a cache of the bindings that had been imported during method compilation, an environment now has a &quot;bindings&quot; dictionary, containing all bindings that are available during compilation. This is much easier to understand, and more similar to the old SystemDictionary approach, which should result in better compatibility. Environments now inform each other when bindings are added and removed, so that the bindings dictionary will always be up to date.</div>
<div><br></div><div>Also, following Nicolas Cellier&#39;s idea<span style="font-family:arial,sans-serif;font-size:13.333333969116211px;font-weight:bold;white-space:nowrap">, </span>the system of imports and exports used to configure an environment is simpler and more &quot;declarative&quot; (to the extent that Smalltalk could ever be considered declarative!). This should make tool support easier to implement. </div>
<div><br></div><div>To try it out, load the packages into a trunk image in this order:</div><div><br></div><div>Environments-cwp.41<br></div><div>Environments-cwp.42<br></div><div>ShoutCore-cwp.40<br></div><div>Environments-cwp.43<br>
</div><div>Tests-cwp.281<br></div><div><br></div><div>In my image, this passes all the Environments tests, and appears to clean up the bindings in the image nicely. This DoIt:</div><div><br></div><div><div>classes := Bag new.</div>
<div>CompiledMethod allInstancesDo:</div><div><span class="" style="white-space:pre">        </span>[:method |</div><div><span class="" style="white-space:pre">        </span>method allLiterals do:</div><div><span class="" style="white-space:pre">                </span>[:literal |</div>
<div><span class="" style="white-space:pre">                </span>classes add: literal class]].</div><div>classes sortedCounts.</div></div><div><br></div><div>answers this:</div><div><br></div><div><div>234856-&gt;ByteSymbol</div><div>
58608-&gt;ClassBinding</div><div>17788-&gt;ByteString</div><div>12419-&gt;SmallInteger</div><div>10495-&gt;Association</div><div>3422-&gt;Array</div><div>2350-&gt;Float</div><div>2328-&gt;Global</div><div>1853-&gt;Character</div>
<div>863-&gt;AdditionalMethodState</div><div>207-&gt;LargePositiveInteger</div><div>61-&gt;LargeNegativeInteger</div><div>50-&gt;ByteArray</div><div>26-&gt;ScaledDecimal</div><div>4-&gt;WideString</div><div>2-&gt;Fraction</div>
</div><div><br></div><div>We have lots of ClassBindings, and some Globals, but no Aliases. AFAICT, the associations in there are class variables. We should probably convert those to Globals at some point. </div><div><br></div>
<div>Colin</div></div>