links to this page:
Squeak FAQ
Swiki Page List
Swiki short page list
FAQ: Copying a class
Last updated at 4:38 pm UTC on 20 December 2021
Question: How do I copy a class?
Answer:
First possibility:
Use ClassDescription>>copyAllCategoriesFrom:.
Specifically, define a class (MyNewClass) and evaluate the following in a workspace:
MyNewClass copyAllCategoriesFrom: Old.
MyNewClass class copyAllCategoriesFrom: Old class.
Second possibility:
fileout the original class,
rename the original class in the image to the new name
file the original class back in (thus recreating the old class in the image).
There may still be a few references to the old class in the renamed class, but the references are easily found and changed.