freenode/lisp - IRC Chatlog
Search
15:59:05
shrdlu68
I have a function that, when called in the REPL, enters into a loop. Is it possible to redefine the function without interrupting it, in SLIME?
16:01:48
marvin2
if you are looping by recursion, which isn't that common in CL, then I guess just redefining it would work, without interrupting it first. not sure if you'd gain much by that though
16:03:51
shrdlu68
I guess what I'm looking for is some way to change the internal state of a running function, which I don't think is possible.
16:30:06
pjb
shrdlu68: you have to write the function specifically for it to be upgradable. First declare it notinline. The new version of the function is taken into account only when you call it again, and when you evaluate (function foo) again. So if your function is in a loop (or just running), it has to exit, and to be called again. It may also call itself recursively, if TCO has not been activated. (notinline should disable it).
16:38:04
pjb
shrdlu68: note: the recursive call can also be done in the debugger, to "manually" remplace the old function call with a new one. But for this you would also want to plan a catch to exit from the inner function call without returning to the debugger or outer function call.
16:40:54
pjb
http://gizmonaut.net/blog/software/multics_source_reveals_le_jetteur_des_gazongues.html