[Rant] Shrinking problems and rampant interdependencies

Scott Wallace sgwallace at pacbell.net
Fri Jul 27 01:23:05 UTC 2001


At 5:28 PM -0700 7/26/01, Tim Rowledge wrote:
>
>...I also spent some time trying to peel StandardScriptingSystem away from
>some of the myriad places it sticks to, but eventually got beaten by its
>partner in crime 'Presenter' which is also everywhere I didn't want it
>to be. I gave up eventually, but I'm sure it must be possible given
>enough aspirin.


Tim,

Notice that there is actually only *one* reference to 
StandardScriptingSystem in the entire image, and that that lone 
reference is in SystemDictionary method #makeExternalRelease, which 
has no senders in the image and which is only called once or twice a 
year, only manually, and only by Dan Ingalls.  So in fact there is 
virtually *nothing* nailing StandardScriptingSystem down.

Instead, there is a global, #ScriptingSystem, which needs to be 
present and which points to an instance of *something*, which need 
not be a StandardScriptingSystem instance.

To solve your problem with very little effort, it should quite easily 
work to define a MiniScriptingSystem class, a simple subclass of 
Object, which will field all the message-sends directed to 
#ScriptingSystem in your trimmed-down image.

Probably, the only message ever sent to ScriptingSystem by any 
objects remaining in your stripped-down system is #formAtKey:.  Maybe 
also #fontForButtons and maybe something else, but in any case the 
set of messages your MiniScriptingSystem will need to handle will be 
very small.

Once you've defined your tiny MiniScriptingSystem class (which will 
serve primarily, or only, to hold on to and provide access to a 
dictionary of Forms,) all you need do is issue:

	Smalltalk at: #ScriptingSystem put: MiniScriptingSystem new

and the next time you apply the shrinking procedure, 
StandardScriptingSystem should be unreferenced (be sure 
SystemDictionary.makeInternalRelease is gone or doctored!) and hence 
should get stripped.

   -- Scott





More information about the Squeak-dev mailing list