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

From: Josep Portella Florit <[email-masked]>
Date: Tue, 30 Jun 2015 15:50:30 +0200

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))))))