Squeak Smalltalk: Error recovery in a live open system
I accidentally changed the subclass of a morph that was open in the world – oops. My screen began filling with dozens of error windows. Right around this time, I started thinking about quitting and rebooting. And then I remembered… this isn’t Windows! I can recover from this – and probably quickly. So I brought up halos on the hosed morph, clicked the delete halo, pressed the user-interrupt shortcut (Cmd-. on Mac) and went for a glass of water – okay, it was wine – stop judging.
Room to Breath
When I got back, I had a debugger open on the event loop, so I knew that the pain had stopped getting worse. Now I just had to figure out what to do about all those error windows.
Like a trained seal, my first move was to press the close button on each one. This got old after the first two, and I remembered I was using Smalltalk.
After years of being institutionalized by Windows… and Mac (yes fanboys, it’s only slightly better than Windows, and can’t begin to touch what Engelbart and Kay were doing in the 1960′s and 1970′s), I constantly forget that I’m working in a live, open system, and do idiotic, inefficient things like hitting the close button on 50 error windows. Like the movie Momento, where he wakes up every day and doesn’t remember who he is or what he’s supposed to be doing…
Back to my senses, I took 10 seconds to write a snippet that closed all the windows:
errorWindows := (World submorphs select: [ :m | (m respondsTo: #label) and: [ m label beginsWith: 'NonBooleanReceiver' ] ]). errorWindows do: [ :e | e delete ]
And I was back in action. Of course, this particular example probably only saved me 10 minutes, but multiply that by X times a day for a year and you get a glimpse of the power of Squeak Smalltalk – a live, open, beautiful system.