How to rename obsolete classes?

Dan Ingalls Dan at SqueakLand.org
Mon Dec 13 07:59:05 UTC 2004


Hi, Ingo -

>I'm trying to rename onsolete classes, using the following code snippet, but I get an "key not found" error in SystemDictionary>>renameClass:as:
>
>SystemNavigation default  obsoleteClasses do: [:c |
>	(c name beginsWith: 'AnObsolete') ifTrue: [
>"		Transcript show: (c name copyFrom: 3 to: c name size); cr."
>		c rename: (c name copyFrom: 3 to: c name size).
>	]
>]
>...
>Any ideas how I can get to rename those classes (I'm trying to clean up the "AnObsolete..." nameing).


Yes.  This is because, by the time a class has been made obsolete, it no longer participates in the normal structures such as the Smalltalk dictionary and the SystemOrganization.    It should suffice in this case simply to use #setName: in place of #rename:.

Hope this helps

	- Dan




More information about the Squeak-dev mailing list