Re: Towards a reasonable unwinding flow-control semantics.
[email protected] (Peter Scott) Wed, 16 Aug 2000 16:13:41 -0700
| Newsgroups | perl.perl6.language.errors |
|---|---|
| Message-ID | <[email protected]> |
At 07:06 PM 8/16/00 -0400, Chaim Frenkel wrote: > >>>>> "GB" == Graham Barr <[email protected]> writes: > > >> There is one case to be considered, what if the try block wishes > >> to avoid its own catch clauses, and start the unwinding with the > >> uplevel try block. > >GB> Can you think of a time you would want that ? > >Here's one. If the catch blocks translate exceptions into a more >domain specific exception. And the try block already knows what to do >with the error. No need to put in a special case, just let it leak >past the catches. > >But more directly, if the exception is directly detected/raised in the >try block itself. I probably wouldn't want to route it through the >local catches. > >The try block knows what the situation is, it did it. So the exception >is aimed at the caller not at itself. I think this has merit. We want throw to be able to throw farther. Maybe: throw_up Exception::Foo(...); to signify that we're going up instead of out. Okay, :-) Got a better syntax? Would you want the option of throwing up n (> 1) levels? -- Peter Scott Pacific Systems Design Technologies