| While reconsidering implementation of protect / dynamic-wind for Arcueid, I got to thinking of a corner case involving the interaction of protect and exceptions. What exception should this code return? (on-err (fn (ex) ex)
(fn ()
(protect (fn ()
(err "foo"))
(fn () (err "bar")))))
In Arc 3.1, this code returns the the "bar" exception raised by the protect handler. The original "foo" exception raised by the protected code is lost. I suppose that is as it should be, but I do believe that there should be some way to retrieve the original exception, rather than the last one raised by protect handlers. What do other languages with similar mechanisms do in this case? |