- (catch #t
- ;; Run the actual code the user requested
- (lambda ()
- body ...)
- ;; If something bad happened and we didn't catch it,
- ;; we'll wrap it up in such a way that the continuation
- ;; can address it
- (lambda (key . args)
- (make-wrapped-exception key args
- (make-stack #t 1 0))))))
+ (let ((exception-stack #f))
+ (catch #t
+ ;; Run the actual code the user requested
+ (lambda ()
+ body ...)
+ ;; If something bad happened and we didn't catch it,
+ ;; we'll wrap it up in such a way that the continuation
+ ;; can address it
+ ;; @@: For this stack to work doesn't it have to be
+ (lambda (key . args)
+ (make-wrapped-exception key args
+ exception-stack))
+ (lambda _
+ (set! exception-stack (make-stack #t 1 0)))))))