Bug in Dynamic Protocols?

Michael Fremont fremontmj at gmail.com
Tue Oct 16 16:44:27 UTC 2007


Thanks for explaining, Damien.

I'm calling #removeFromSystemUnlogged because my program dynamically
creates, uses, and discards lots of classes; logging all this makes it
hard for me to see what really matters in the changeset.

It seems to me that asking for something not to be *logged* is not the
same as asking for side-effects like hanging onto a class that no
longer exists.

However, looking at the comment for
SystemDictionary>>forgetClass:logged:, it says: 'Note that this
doesn't do everything required to dispose of a class - to do that use
Class>>removeFromSystem.  I call >>removeFromSystemUnlogged.

I see also that in forgetClass>>logged, you must be depending on the
SystemChangeNotifier>>classRemoved:fromCategory call to be notified...
and that makes sense.

I guess my problem is that I want only *some* side-effects, and not others!

Thanks for your excellent work!

Best,

Mike

On 10/15/07, Damien Cassou <damien.cassou at gmail.com> wrote:
> Hi Michael
>
> 2007/10/15, Michael Fremont <fremontmj at gmail.com>:
> > I have now downloaded the same image you're using.  I make no changes
> > to it whatsoever.  Doing 'SystemNavigation default obsoleteClasses'
> > returns an empty array.
> >
> > Then I make a new class 'Test'.  I delete it by doing: 'Test
> > removeFromSystemUnlogged' in a workspace.
>
>
> How do you want DynamicProtocols to update its cache if you explicitly
> say «remove this silently»? Please send #removeFromSystem instead and
> DynamicProtocols will be notified.
>
>
> > Now 'SystemNavigation default obsoleteClasses' returns (AnObsoleteTest).
> >
> > Using PointerFinder I see that DPRecentlyModified's cache is holding a
> > reference to the deleted class.
> >
> > Perhaps the problem is I'm not deleting the class through the browser?
>
>
> You can bypass the browser, but you must use the notification system.
>
>
> > I also noticed that turning off dynamicProtocolActivation in the
> > Preference Browser doesn't make a difference;
>
>
> It depends when you deactivate them. If you deactivate them in the
> begining, their cache should not be updated. If you deactivate them
> after having removed the class, it doesn't change anything.
>
> > and if I make a method
> > with 'self halt' in it, the OB shows a red flag for that method, even
> > though I turned off BOTH dynamicProtocolActivation AND Debugging.
>
>
> The red flag is not part of the dynamicprotocols. It's a feature of
> the OmniBrowser.
>
>
> > Very strange.
>
> I hope things get clearer now.
>
> --
> Damien Cassou
>
>
>
>



More information about the Squeak-dev mailing list