[squeak-dev] The Inbox: Kernel-cmm.830.mcz

Frank Shearar frank.shearar at gmail.com
Wed Jan 8 07:46:07 UTC 2014


On 08 Jan 2014, at 3:36, Chris Muller <asqueaker at gmail.com> wrote:

> Command+X on TestCase in the browser.  Sweet.  :)
>
> On Tue, Jan 7, 2014 at 9:31 PM,  <commits at source.squeak.org> wrote:
>> A new version of Kernel was added to project The Inbox:
>> http://source.squeak.org/inbox/Kernel-cmm.830.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Kernel-cmm.830
>> Author: cmm
>> Time: 7 January 2014, 9:31:35.206 pm
>> UUID: 43453587-ee4b-48e4-93ec-43983f0c82ed
>> Ancestors: Kernel-fbs.829
>>
>> Removing a class should remove its subclasses too.
>>
>> =============== Diff against Kernel-fbs.829 ===============
>>
>> Item was changed:
>>  ----- Method: Class>>removeFromSystem: (in category 'initialize-release') -----
>>  removeFromSystem: logged
>>        "Forget the receiver from the Smalltalk global dictionary. Any existing
>>        instances will refer to an obsolete version of the receiver."
>>
>>        "keep the class name and category for triggering the system change message. If we wait to long, then we get obsolete information which is not what we want."
>>
>>        "tell class to deactivate and unload itself-- two separate events in the module system"
>> +       self subclassesDo: [ : each | each removeFromSystem: logged ].

I'd rather see this as a separate selector, maybe
#removeFromSystemRecursively: or #removeFromSystemWithSubclasses or
something:. Imagine you're unloading a package. Often there will be
several 'root' classes in your package: a base domain object, a base
exception, other bits. How can I write a package unloader to unload
your package? Either I have to understand your package structure, or I
end up calling #removeFromSystem: multiple times for non-root classes
(because MCClassDefinition will do this when it unloads).

I'd be happy to see it used via cmd-X, perhaps with certain guards, or
a confirmation saying "this will remove Foo, SubFoo, SubSubFoo and
FooNotification. Are you sure?"

frank

>>        self deactivate; unload.
>>        self superclass ifNotNil:
>>                ["If we have no superclass there's nothing to be remembered"
>>                self superclass addObsoleteSubclass: self].
>>        self environment forgetClass: self logged: logged.
>>        self obsolete.!
>>
>>
>


More information about the Squeak-dev mailing list