Re: Toward an omnibus Perl 6 Exceptions RFC, v0.1.

[email protected] (Tony Olekshy) Wed, 16 Aug 2000 21:14:11 -0600
Newsgroups perl.perl6.language.flow
Organization Avra Software Lab Inc.
Message-ID <[email protected]>
Kai Henningsen wrote:
> 
> Tony Olekshy wrote:
> 
> > What if we implemented something like the following?
> 
> Seems that the basic unwinder is
> 
> >     except { ... } => catch { ... }
> 
> and everything else can be written in terms of this:
> 
> >     catch { ... }
> 
> except { 1 } => catch { ... }

Yes.  But a simple try { } catch { } is a common use.

> >     catch "ClassName" { ... }
> 
> except { $@->isa($ClassName") } catch { }

Yes.  This one's clearly syntactic sugar, but it may very well be
quite a common usage if Perl 6 goes to internal error exceptions.

> >     finally { ... }
> 
> except { 1 } => catch { ... ; throw $@ }

No.  The finally clause must be invoked whether or not anything
has thrown since the beginning of the try.  Except { 1 } will
*not* match if nothing has been thrown.  Catch and finally are
semantically very distinct.

Yours, &c, Tony Olekshy