Re: Low-level vs high-level exceptions Marc Nieper-WiÃkirchen 07 Jun 2020 15:45 UTC
Am So., 7. Juni 2020 um 15:59 Uhr schrieb Lassi Kortela <firstname.lastname@example.org>: > > > It may make sense to define a class of exceptions that cannot be > > caught by user provided handlers. This can include all exceptions a > > Scheme system raises where the standard just says "... it is an > > error". (*) > > > The advantage of (*) is also that the danger inherent in the > > else-clause in the standard guard form would be diminished. > > This could also be approached from the other direction by defining a new > `guard%` that catches absolutely everything, and implement the standard > `guard` so that it only catches "normal" high-level exceptions. If > necessary for conformance, the low-level exceptions can be called by > some other name than "exception". Guard is defined in terms of `with-exception-handler', so `with-exception-handler' couldn't catch the "unnormal" low-level exception either. But again, this may be a good thing. Catching low-level exceptions with implementation-specific handlers makes much more sense.