mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-08 13:37:35 +02:00
Fixing bug in exception-protect.
This commit is contained in:
parent
9f518e56c4
commit
45f7d85360
1 changed files with 6 additions and 6 deletions
|
@ -997,12 +997,12 @@
|
||||||
;; Similar to unwind-protect, but allows escape via continuations
|
;; Similar to unwind-protect, but allows escape via continuations
|
||||||
;; assuming they'll return, whereas exceptions are assumed to not return.
|
;; assuming they'll return, whereas exceptions are assumed to not return.
|
||||||
(define (with-exception-protect thunk final)
|
(define (with-exception-protect thunk final)
|
||||||
(let ((finalized? #f)
|
(let* ((finalized? #f)
|
||||||
(run-finalize
|
(run-finalize
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(cond ((not finalized?)
|
(cond ((not finalized?)
|
||||||
(set! finalized? #t)
|
(set! finalized? #t)
|
||||||
(final))))))
|
(final))))))
|
||||||
(with-exception-handler
|
(with-exception-handler
|
||||||
(lambda (exn)
|
(lambda (exn)
|
||||||
(run-finalize)
|
(run-finalize)
|
||||||
|
|
Loading…
Add table
Reference in a new issue