Subject: bug#39811: closed (Re: bug#39811: Missing dynwind exit application)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 03 Mar 2020 20:35:02 +0000

Your bug report

#39811: Missing dynwind exit application

which was filed against the guile package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
39811: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=39811
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#39811: Missing dynwind exit application
From: Andy Wingo <[email-masked]>
To: Stefan Israelsson Tampe <[email-masked]>
Cc: [email-masked]
Date: Tue, 03 Mar 2020 21:33:47 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Stefan Israelsson Tampe <[email-masked]> writes:

> Executing this code on guile-3.0.0:
>
> (dynamic-wind
>  (lambda () (pk 'enter))
>  (lambda () (catch #t
>               (lambda () (throw 1))
>               (lambda x (pk 'catch x) (apply throw x))))
>  (lambda () (pk 'leave)))
>
> Leads to the output:
>
> scheme@(guile-user)> (load "bug.scm") 
> ;;; (enter) 
> ;;; (catch (a)) 
>
> ice-9/boot-9.scm:1669:16: In procedure raise-exception: 
> Throw to key `a' with args `()'. 
>
> What, it does not execute the leave part of the dynamic wind.

That is because the REPL leaves you in the context of where the uncaught
error was thrown.  If you ,quit the REPL to go back to the outer REPL,
it will print "leave" as expected.  Please reopen if I have
misunderstood :)

Cheers,

Andy

Subject: Missing dynwind exit application
From: Stefan Israelsson Tampe <[email-masked]>
To: [email-masked]
Date: Thu, 27 Feb 2020 19:59:25 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Executing this code on guile-3.0.0:

(dynamic-wind
 (lambda () (pk 'enter))
 (lambda () (catch #t
              (lambda () (throw 1))
              (lambda x (pk 'catch x) (apply throw x))))
 (lambda () (pk 'leave)))

Leads to the output:

scheme@(guile-user)> (load "bug.scm")
;;; (enter)
;;; (catch (a))

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Throw to key `a' with args `()'.

What, it does not execute the leave part of the dynamic wind.

This works however,

(catch #t
  (lambda ()
    (dynamic-wind
      (lambda () (pk 'enter))
      (lambda () (catch #t
                   (lambda () (throw 'a))
                   (lambda x (pk 'catch x) (apply throw x))))
      (lambda () (pk 'leave))))
  (lambda x #f))

So is this how it should be?