Michael Rueger wrote:
Hi all,
this tiny goodie removes all entries without references from Undeclared. Maybe this should be called after every file in.
Michael
You might want to check on how the references are computed- another thing of interest is to check whether methods are referencing variables which are not only not in Smalltalk, but are not in Undeclared- thus, a compiled method has a binding for a variable ( an association in Squeak ) but that particular association is not in Smalltalk or any of the other pools ( those for class variables, or in shared pools, of which Smalltalk and Undeclared are well known shared pools ).
Or, to put it another way, rather than have just a tool to "clean up" Undeclared, have a tool that assures the consistency of the variables bound within the image.
A more involved solution would take a while to describe, but involves having code-altering entities keep track of what they are doing so that they can retract interests in particular variables when they leave. It is then up to the "image" to decide when a variable would be dropped from some shared pool.
- les