[Top][All Lists]

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

Re: debugger restarts

From: Andy Wingo
Subject: Re: debugger restarts
Date: Mon, 20 Jun 2016 12:53:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

On Fri 05 Feb 2016 10:26, address@hidden (Ludovic Courtès) writes:

> 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:
>> 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:
> 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?

I think in general we should not make a change that would allow any
`throw' to return directly.  That would break programs.  However
something like:

  (define %exits (make-parameter '()))
  (define-syntax-rule (with-exits name body ...)
    (let/ec exit
      (parameterize ((%exits (acons name exit (%exits))))
        body ...)))

and the debugger knows to look in %exits for potential exits -- that can
work fine too.  Or the debugger can know how to re-call a procedure with
new arguments or something...


reply via email to

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