guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debugger restarts


From: Ludovic Courtès
Subject: Re: debugger restarts
Date: Fri, 05 Feb 2016 10:26:28 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Federico Beffa <address@hidden> skribis:

> I've been playing a little bit with MIT Scheme and have noticed a very
> nice feature of the debugger: when you hit an error and enter the
> debugger, it allows you to continue execution of a program with a user
> supplied value (restarts).
>
> Looking for such a feature in Guile I've found this old thread:
>
> https://lists.gnu.org/archive/html/guile-user/2011-10/msg00033.html
>
> which suggests that it isn't. I'm wondering if something has moved in
> that direction since then.

Sorry for the laaate reply!  Unfortunately no, nothing has been done in
that direction, but it’d still be a welcome addition!

Currently the behavior of ‘throw’ (in boot-9.scm) is that it always
aborts to the catch prompt and runs the ‘throw’ handler from there; the
continuation of the faulty code is not captured, and thus cannot be
resumed like MIT Scheme’s (restart 2) does:

        (call-with-prompt
         tag
         (lambda ()
           (with-fluids
               ((%exception-handler
                 (if pre-unwind-handler
                     (custom-throw-handler tag k pre-unwind-handler)
                     (default-throw-handler tag k))))
             (thunk)))
         (lambda (cont k . args)   ;<- here we would want to call CONT
           (apply handler k args)))

We would need to make this customizable.  However, we don’t want to
systematically reify ‘cont’ here because that would be too costly.

I’m not sure how to approach this.  Maybe Andy or Mark know better?

Ludo’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]