Re: Towards a reasonable unwinding flow-control semantics.
[email protected] (Tony Olekshy) Wed, 16 Aug 2000 21:14:49 -0600
| Newsgroups | perl.perl6.language.errors |
|---|---|
| Organization | Avra Software Lab Inc. |
| Message-ID | <[email protected]> |
Graham Barr wrote:
>
> On Wed, Aug 16, 2000 at 10:19:53AM -0400, Chaim Frenkel wrote:
> >
> > I would say that outside of the try block all throws are caught if
> > at all by the wrapping try. So that throws propogate outward. Never
> > back within itself.
>
> Agreed.
Throws propagate *forward* through the try clauses, then *outward*
if not cleanly caught. We're not proposing any notion of throws
propagating *inward*.
> > 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.
>
> Can you think of a time you would want that ?
And even if you did, don't you just want something like this:
try {
$avoidCatches_JustUnwind = predicate();
}
except { $avoidCatches_JustUnwind } => catch { throw }
.
. Other catch clauses go here, and are attempted only
. if $avoidCatches_JustUnwind is false after try.
.
finally {
# Can't be avoided. Don't use this clause otherwise.
}
Yours, &c, Tony Olekshy