Subject: bug#20938: closed (Re: bug#20938: make-dynamic-state, with-dynamic-state & exceptions)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 28 Feb 2017 14:18:02 +0000

Your bug report

#20938: make-dynamic-state, with-dynamic-state & exceptions

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].

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

Subject: Re: bug#20938: make-dynamic-state, with-dynamic-state & exceptions
From: Andy Wingo <[email-masked]>
To: Josep Portella Florit <[email-masked]>
Cc: [email-masked]
Date: Tue, 28 Feb 2017 15:17:29 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

On Tue 30 Jun 2015 15:50, Josep Portella Florit <[email-masked]> writes:

> This code crashes Guile 2.0.11:
>
> (define x (make-dynamic-state))
> (with-dynamic-state x (lambda () (/ 1 0)))

Sad :/ Fixed in 2.2 though, finally.  I don't really know how to fix it
in 2.0 though.  Marking as closed given that we will have a shiny new
2.2.0 soon.

Andy

Subject: make-dynamic-state, with-dynamic-state & exceptions
From: Josep Portella Florit <[email-masked]>
To: [email-masked]
Date: Tue, 30 Jun 2015 15:50:30 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

This code crashes Guile 2.0.11:

(define x (make-dynamic-state))
(with-dynamic-state x (lambda () (/ 1 0)))

For now I'm using this workaround:

(let ((w-d-s with-dynamic-state))
  (set! with-dynamic-state
        (lambda (s p)
          (let ((e #f))
            (w-d-s s (lambda ()
                       (catch #t p
                         (lambda x (set! e x)))))
            (when e (apply throw e))))))