From: Attila L. <att...@gm...> - 2008-03-13 20:45:34
|
On 13 Mar 2008 22:19:21 +0200, Juho Snellman <js...@ik...> wrote: > "Attila Lendvai" <att...@gm...> writes: > > +(defun restart-frame (frame) > > + "Try to restart execution at FRAME. If it's not possible (e.g. due to > > +inadequate debug level) then this function returns with (VALUES) ." > > + (when (frame-has-debug-tag-p frame) > > + ;; FIXME: Getting the first entry in FRAME-CALL-AS-LIST is just plain > > + ;; wrong but sometimes accidentally work. Find a way to get hold of the > > + ;; function of the current frame and don't forget about fixing Slime either. > > Getting hold of the function would be the wrong thing to do. The > workflow of the people who use RESTART-FRAME is to fix a bug, redefine > the function, and then restart the frame. If you use the function > object corresponsing to the frame, you'll be restarting the buggy > version instead of the fixed version. i may be off here, but i've always wanted to restart at older frames than where i was fixing a problem. but as i haven't used it much yet (because i've hardly seen it working from slime), this is fwiw... > Sure, this means that only functions visible in the global function > namespace are restartable. But that's pretty far from "only sometimes > accidentally works". well, before my frame cleaning changes, frame-call-as-list used to return all kind of things as car of the result, which was often something else then a symbol naming a function. but your point is completely valid. in the lights of this i suggest to keep this code, but then add a :verbosity 1 to the call to frame-call-as-list and if that fails to return anything usable, then try to look up the function of the requested frame. that way it would pick up redefined functions, but also work for frames for which frame-call-as-list does not return a valid function name. -- attila |