How do I undo the removal of a method in Squeak Smalltalk?
Asked
Active
Viewed 547 times
3 Answers
10
- 'World Menu'->'open'->'simple change sorter'
- In the top-right pane, select the class from which the method was removed.
- In the middle pane, select the removed method.
- Right click on the method name, bringing up a menu
- Select "versions"
- When the versions tool comes up, select the top (most recent) version, which is the one you deleted.
- Click the "revert" button
When you browse your class, you will see that the method is restored.

Sean DeNigris
- 6,306
- 1
- 31
- 37
-
Wow, this is wild! Thanks Sean. – Edward Ocampo-Gooding Jun 25 '12 at 04:48
-
This is the magic of a live, open, dynamic system like Smalltalk :) – Sean DeNigris Jun 26 '12 at 12:29
4
If you use OmniBrowser and the Refactoring Tools you have unlimited undo/redo on all your code changes like in any other modern editor. Select in the context menu Refactor > Undo.

Lukas Renggli
- 8,754
- 23
- 46
-
Thanks Lukas! After I finish [this epic tutorial](http://squeak.preeminent.org/tut2007/html/035C.html) I’ll learn how to install packages in Squeak and will give OmniBrowser a shot. – Edward Ocampo-Gooding Jun 25 '12 at 13:42
4
You can open your changes file:
- Tools menu at the top of your screen.
- File List (which should open in the right place).
- In the upper right pane select the changes file (given an image called Foo.image, you'd look for Foo.changed).
- Hit the "recent changes" button, browsing as far back as the latest (top) snapshot.
- All method additions, alterations, deletions, DoIts are listed in the list that pops up.
- Select the method/s you want, right click (I can never remember the colours for mouse buttons) and "fileIn selections".

Frank Shearar
- 17,012
- 8
- 67
- 94
-
Cool! That’ll be handy when I’ve forgotten where the removed method came from. Thanks for showing me something new about Smalltalk. – Edward Ocampo-Gooding Jun 25 '12 at 13:50