> ...inspected the stack, patch the function, and then had it pick back up...
After you edit the live state of the program, how do you translate that into code sitting in source control? Do you save this blob of memory and pass that down through generations?
2. Modify the source code containing the function.
2a. Save the file.
3. Copy function definition to the debugger’s repl, and evaluate it.
4. Resume the system from frame that calls the function.
But yes, you must be diligent about making sure the source files contain the code that is actually running, but that’s not much different than artifact tracking.
Step a): One just evaluates from the sources, while changing them. Once done -> save sources.
Step b): Create a patch file, which changes the image. Such a patch file can be loaded while starting an image, until one decides to save a new image with the changes already loaded.
For example there is a new release for the commercial LispWorks IDE once every one or two years. Users usually get only patch files for bug fixes during the one or two years maintenance. Thus I have a directory for patches to LispWorks, which are loaded when I start the base image.
There are tutorials all over the place however as Smalltalk is a system that, like Lisp, has dialects, they tend to be system specific. Lots of material at http://stephane.ducasse.free.fr/FreeBooks.html .
Just because that feature is available and at one time was desirable (when machines were so slow, that compiling would break the flow), doesn't mean one needs to or should use it today.
I had a bug in a long running program that would only show up after like six hours. I couldn’t replicate it in isolation because it had something to do with how state was being maintained. I set a conditional breakpoint right before the crash, inspected the stack, patch the function, and then had it pick back up by reëvaluating the current function call.
Damn thing just worked. It was amazing, and saved me so much time.