On Tue, 14 Jul 2020 12:32:46 +0200 Catonano <caton...@gmail.com> wrote: > Il giorno dom 12 lug 2020 alle ore 21:33 Chris Vine <vine35792...@gmail.com> > ha scritto: > > On Sun, 12 Jul 2020 20:14:23 +0100 > > Chris Vine <vine35792...@gmail.com> wrote: > > [snip] > > > Secondly, if the handler returns and #:unwind? is set to #f then > > > raise-continuable will return with the value returned by the handler. > > > So this: > > > > > > (with-exception-handler > > > (lambda (x) (+ x 3)) > > > (lambda () (+ (raise-continuable 10) 6))) > > > > Ah I see you are using (ice-9 exceptions). Better be consistent with this: > > > > (with-exception-handler > > (lambda (x) (+ x 3)) > > (lambda () (+ (raise-exception 10 #:continuable? #t) 6)))) > > I find this a little bit confusing, admittedly > > so is it > > #:unwind #f > > on with-exception-handler and > > #:continuable #t > > on raise exception ?
If you want a continuable exception then you don't unwind. If you unwind there is no difference between a continuable exception and a non-continuable one - you have unwound the stack and that's it. If the exception is non-continuable (as most are), you must either unwind, or you must in the exception handler re-raise the exception or invoke your own continuation object.