[squeak-dev] Empty categories

Eliot Miranda eliot.miranda at gmail.com
Tue Feb 9 21:36:26 UTC 2010


On Tue, Feb 9, 2010 at 11:20 AM, Edgar J. De Cleene <
edgardec2001 at yahoo.com.ar> wrote:

>
>
>
> On 2/9/10 11:58 AM, "Torsten Bergmann" <astares at gmx.de> wrote:
>
> > Shouldnt we run a script on trunk to remove empty
> > categories to clean up a little bit?
>
> Trying to see if the cleanup I have was in Squeak3.11-8931-alpha.image
> originate the attached walkback
>
> The error was with the .cs via drag and drop and selecting code browser
> Using message names tool I see no cleanup in image, so I copy paste here.
> Come from original code of Ramon Leon and IMHO should be used before any
> image go to ftp
>
> !SmalltalkImage methodsFor: 'image cleanup' stamp: 'edc 12/13/2009 08:34'!
> cleanup
>    "SmalltalkImage current cleanup"
>    | tasks |
>    Transcript open.
>    tasks := OrderedCollection new
>                add: [Smalltalk removeEmptyMessageCategories];
>
>                add: [Workspace
>                        allSubInstancesDo: [:each | each setBindings:
> Dictionary new]];
>
>                add: [Undeclared removeUnreferencedKeys];
>
>                add: [Categorizer sortAllCategories];
>
>                add: [Symbol compactSymbolTable];
>
>                add: [#(#TheWorldMenu #FileServices #AppRegistry
> #Preferences #FileList )
>                        do: [:cl | (Smalltalk at: cl) removeObsolete]];
>
>                add: [Flaps freshFlapsStart];
>
>                add: [MCFileBasedRepository flushAllCaches];
>
>                add: [HandMorph releaseCachedState; initForEvents.
>                    self fixObsoleteReferences];
>
>                add: [Smalltalk forgetDoIts.
>                    DataStream initialize.
>                    Behavior flushObsoleteSubclasses.
>                    "The pointer to currentMethod is not realy needed
>                    (anybody care to fix this) and often holds on to
>                    obsolete bindings"
>                    MethodChangeRecord
>                        allInstancesDo: [:each | each noteNewMethod: nil].
>                    Smalltalk garbageCollectMost];
>                 yourself.
>    Utilities
>        informUserDuring: [:bar | tasks
>                do: [:block |
>                    bar value: block printString.
>                    [block value]
>                        on: Error
>                        do: [:error | Transcript show: error;
>                                 cr]]].
>    SystemNavigation default obsoleteClasses isEmpty
>        ifTrue: [SmalltalkImage current saveSession]
>        ifFalse: [SystemNavigation default obsoleteClasses
>                do: [:each |
>                    self halt.
>                    [PointerFinder on: each]
>                        on: Error
>                        do: [:error | Transcript show: error;
>                                 cr]]]! !
>
> Edgar


Pedantry:
                   [block value]
                       on: Error
                       do: [:error | Transcript show: error;
                                cr]]].

is equivalent to

                   block
                       on: Error
                       do: [:error | Transcript show: error;
                                cr]]].


>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100209/d542126b/attachment.htm


More information about the Squeak-dev mailing list