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

2000-08-17 Thread Tony Olekshy
Peter Scott wrote: > Tony Olekshy wrote: > >Peter Scott wrote: > > > Tony Olekshy wrote: > > > > > > > > try { TryToFoo; } > > > > catch { TryToHandle; } > > > > finally { TryToCleanUp; } > > > > catch { throw "Can't cleanly Foo."; }; > > > > > > > > In our

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

2000-08-17 Thread Peter Scott
At 09:13 PM 8/16/00 -0600, Tony Olekshy wrote: >Peter Scott wrote: > > > > Tony Olekshy wrote: > > > > > > try { TryToFoo; } > > > catch { TryToHandleFailure; } > > > finally { TryToCleanUp; } > > > catch { throw "Can't cleanly Foo."; }; > > > > > >In our pr

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

2000-08-16 Thread Peter Scott
At 09:14 PM 8/16/00 -0600, Tony Olekshy wrote: >Jonathan Scott Duff wrote: > > > > I can almost see what you're talking about but not quite. It sounds > > like you want caller() info available to the exception handler... but > > isn't it? > >The basic problem is that the stack traceback at the ti

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

2000-08-16 Thread Tony Olekshy
Jonathan Scott Duff wrote: > > I can almost see what you're talking about but not quite. It sounds > like you want caller() info available to the exception handler... but > isn't it? The basic problem is that the stack traceback at the time of catching is not the same as the stack traceback at

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

2000-08-16 Thread Tony Olekshy
Peter Scott wrote: > > Tony Olekshy wrote: > > > > try { TryToFoo; } > > catch { TryToHandleFailure; } > > finally { TryToCleanUp; } > > catch { throw "Can't cleanly Foo."; }; > > > >In our production code we often add such blocks to major API entry > >point

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

2000-08-16 Thread Tony Olekshy
Peter Scott wrote: > > Tony Olekshy wrote: > > > >[snip]And the following output was generated: > > > > Exception > > > > $ = Try::throw('Exception') called from scott2.pm[8]. > > $ = main::pling('Test') called from scott2.pm[4]. > > $ = main::bar('Test') called from scott1.pl[1].

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

2000-08-16 Thread Chaim Frenkel
> "JSD" == Jonathan Scott Duff <[EMAIL PROTECTED]> writes: JSD> On Wed, Aug 16, 2000 at 12:36:42PM -0700, Peter Scott wrote: >> If you use a switch statement and want implicit rethrow (and I do), then >> your exception handler somehow has to look inside the switch to see if an >> exception

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

2000-08-16 Thread Peter Scott
At 12:00 AM 8/16/00 -0600, Tony Olekshy wrote: >However, many people have broached topics such as conditional catch >blocks (such as those based on the exception's isa relationships), >multiple catch clauses with varying conditions, and post-finally >catch blocks. > >I agree that we don't have a g

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

2000-08-16 Thread Jonathan Scott Duff
On Wed, Aug 16, 2000 at 12:36:42PM -0700, Peter Scott wrote: > If you use a switch statement and want implicit rethrow (and I do), then > your exception handler somehow has to look inside the switch to see if an > exception was handled. Even if that's possible, it implies a level of > incestuo

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

2000-08-16 Thread Peter Scott
At 10:08 AM 8/16/00 -0400, Chaim Frenkel wrote: >What in the simple methodology combined with Damian's switch monster, >is missing? > >I'll hazard a guess that, if the complex syntax goes in and if there >is no semantic issue, -internals will likely convert the complex >version internally to a swi

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

2000-08-16 Thread Peter Scott
At 02:01 PM 8/16/00 -0500, Jonathan Scott Duff wrote: >On Wed, Aug 16, 2000 at 11:46:12AM -0700, Peter Scott wrote: > > At 12:10 AM 8/16/00 -0500, Jonathan Scott Duff wrote: > > >Why not have a special array that acts as an exception stack and each > > >exception knows what file/line/whatever? Th

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

2000-08-16 Thread Jonathan Scott Duff
On Wed, Aug 16, 2000 at 11:46:12AM -0700, Peter Scott wrote: > At 12:10 AM 8/16/00 -0500, Jonathan Scott Duff wrote: > >Why not have a special array that acts as an exception stack and each > >exception knows what file/line/whatever? Then you can get both behaviors > >with a simple for loop: > >

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

2000-08-16 Thread Peter Scott
At 12:10 AM 8/16/00 -0500, Jonathan Scott Duff wrote: >Why not have a special array that acts as an exception stack and each >exception knows what file/line/whatever? Then you can get both behaviors >with a simple for loop: > > for (@PERL::EXCEPTIONS) { > print $_->file, "\t",

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

2000-08-16 Thread Peter Scott
At 07:40 PM 8/15/00 -0600, Tony Olekshy wrote: > > > catch { ... } > > > > > > Invoked if unwinding. This is a post-finally catch, > > > > What's this for? If the finally block throws? > >Actually it's invoked if we're unwinding at that point, according to >the definition of unwindin

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

2000-08-16 Thread Jonathan Scott Duff
On Tue, Aug 15, 2000 at 11:59:50PM -0600, Tony Olekshy wrote: > > for (@PERL::EXCEPTIONS) { > > print $_->file, "\t", $_->line, "\n"; > > } > > Yawn. That's the way RFC 88 v1 does it. Check it out. I've read it ... perhaps that's what even gave me the idea, but that

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

2000-08-16 Thread Chaim Frenkel
> "TO" == Tony Olekshy <[EMAIL PROTECTED]> writes: TO> However, many people have broached topics such as conditional catch TO> blocks (such as those based on the exception's isa relationships), TO> multiple catch clauses with varying conditions, and post-finally TO> catch blocks. TO> I agree

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

2000-08-15 Thread Tony Olekshy
I have moved this to [EMAIL PROTECTED] Chaim Frenkel wrote: > > Sorry, I keep reading [except], even with your explanation, as > "ignore this [catch]". A more positive word would be better. I take your point. Patches are welcome ;-) > I haven't seen a good reason that it should be any more co

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

2000-08-15 Thread Tony Olekshy
Jonathan Scott Duff wrote: > > On Tue, Aug 15, 2000 at 05:14:56PM -0700, Peter Scott wrote: > > > > I want: exceptions to contain 'file' and 'line' attributes which > > are arrays that get a location pushed on every time an exception > > bubbles up through a scoping level. > > Why not have a spe