Re: Structured exception handling should be a core module.

2000-08-24 Thread Peter Scott
At 06:48 PM 8/24/00 -0600, Tony Olekshy wrote: >Peter Scott wrote: > > > > At 06:06 PM 8/24/00 -0600, Tony Olekshy wrote: > > > > > >In fact, not only would I be pleased and honoured to author the > > >Perl 6 core Try.pm module, I'm already working on a Perl 5 standard > > >reference implementatio

Re: Structured exception handling should be a core module.

2000-08-24 Thread Tony Olekshy
Peter Scott wrote: > > At 06:06 PM 8/24/00 -0600, Tony Olekshy wrote: > > > >In fact, not only would I be pleased and honoured to author the > >Perl 6 core Try.pm module, I'm already working on a Perl 5 standard > >reference implementation. > > >Peter, I think we should make this approach more c

Re: Structured exception handling should be a core module.

2000-08-24 Thread Peter Scott
At 06:06 PM 8/24/00 -0600, Tony Olekshy wrote: >In fact, not only would I be pleased and honoured to author the >Perl 6 core Try.pm module, I'm already working on a Perl 5 standard >reference implementation. That should certainly tell you whether it's doable :-) >Peter, I think we should make th

Re: On the case for exception-based error handling.

2000-08-24 Thread Tony Olekshy
Glenn Linderman wrote: > > Tony Olekshy wrote: > > > > Glenn Linderman wrote: > > > > > > actually wrapping a bunch of code inside a try block > > > affects how that code reacts to die, thus affecting the > > > behavior of the program that previously used die to mean > > > terminate the program.

Structured exception handling should be a core module.

2000-08-24 Thread Tony Olekshy
Graham Barr wrote: > Peter Scott wrote: > > Tony Olekshy wrote: > > > Graham Barr wrote: > > > > > > > > I am of the opinion that only a class name should follow > > > > catch. If someone wants to catch based on an expression > > > > they should use > > > > > > > > catch { > > > > if () { >

Re: On the case for exception-based error handling.

2000-08-24 Thread Tony Olekshy
Peter Scott wrote: > > Tony Olekshy wrote: > > > > I just don't think that with with respect to the infrastructure > > mechanism per se, "fatality" should have anything to do with it. > > In the end, that's a judgement call; that's what we get paid the > > big bux for ;-) > > I have reservations a

Re: RFC 140 (v1) One Should Not Get Away With Ignoring System Call Errors

2000-08-24 Thread Chaim Frenkel
> "JH" == Jarkko Hietaniemi <[EMAIL PROTECTED]> writes: >> But the drawback would be that the actual victim may not be the primal >> cause. >> >> sub foo { >> my $fh = open(); >> ... Lots more code ... >> return $fh; >> } >> >> $victim = foo; >> print $victim "I'm helpless"; JH> Tough.

Re: Why "fatal" errors aren't special.

2000-08-24 Thread Glenn Linderman
Peter Scott wrote: > At 11:21 AM 8/24/00 -0700, Glenn Linderman wrote: > >By building up a > >non-fatal error handling technique on top the existing fatal error > >handling technique, you are forcing code that assumes it will die to > >behave differently, when you wrap a try block around it. Now

Examples from RFC 88 redone using RFC 119 facilities [Was: Re: RFC 88 (v2) Omnibus Structured Exception/Error Handling Mechanism]

2000-08-24 Thread Glenn Linderman
Tony, Having done the exercise of redoing all your RFC 88 examples into RFC 119 syntax, I conclude that the two biggest differences between the syntaxes is the explicit or implicit try, which is mostly an irrelevant placeholder; some like it, some don't. The biggest syntax simplifications came i

Re: Why "fatal" errors aren't special.

2000-08-24 Thread Peter Scott
At 11:21 AM 8/24/00 -0700, Glenn Linderman wrote: >By building up a >non-fatal error handling technique on top the existing fatal error >handling technique, you are forcing code that assumes it will die to >behave differently, when you wrap a try block around it. Now it will only >"maybe" die.

Re: Why except and always should be a seperate RFC.

2000-08-24 Thread Glenn Linderman
Tony Olekshy wrote: > Other than for the except and always clauses, RFC 199 is very > similar to RFC 88. I like the idea behind except and always, > but I think the proposed implementation could be dramatically > simplified. > > The first thing to realize is that just because 119 doesn't say > "

Re: Why "fatal" errors aren't special.

2000-08-24 Thread Glenn Linderman
Tony Olekshy wrote: > Some discussion has suggested that it might be a good idea if it > were possible to have a simple way to prevent catch from catching > so-called "fatal" errors. Some fringe ideas have actually included > two seperate mechanisms, one for so-called fatal errors (based on > di

Re: Why $@ should be structured data.

2000-08-24 Thread Glenn Linderman
Tony Olekshy wrote: > There you have it. That's why RFC 88 uses structured data for $@. That's a good argument, one that I have no quarrel with. As an enhancement to eval/die, this would make it more flexible for checking conditions. And with appropriate stringification, it is upward compatib

Re: RFC 119v2: Object neutral error handling via exceptions

2000-08-24 Thread Glenn Linderman
Tony Olekshy wrote: > Yes, well, at this point I must re-iterate that (in light of reasons > for the existence of a try keyword that I have explained in other > messages), what you've written is the same as: > > try { ... } finally { &do_something(); } Yes, they are equivalent. And note

Re: Exception handling [Was: Re: Things to remove]

2000-08-24 Thread Glenn Linderman
Tony Olekshy wrote: > Glenn Linderman wrote: > > > I do recall seeing this quote; however, replacing AUTOLOAD is a very > > specific instance of resuming from or retrying a fault condition. And > > even though a retry mechanism could be generalized from AUTOLOAD to > > handling other conditions,

Re: RFC 140 (v1) One Should Not Get Away With Ignoring System Call Errors

2000-08-24 Thread Jarkko Hietaniemi
On Thu, Aug 24, 2000 at 02:09:15PM -0400, Chaim Frenkel wrote: > > "JH" == Jarkko Hietaniemi <[EMAIL PROTECTED]> writes: > > JH> "The first operation done on the return value of open() shall be defined() > JH> or you shall regret your pitiful existence."? (a flag on the scalar coming > JH> fr

Re: RFC 140 (v1) One Should Not Get Away With Ignoring System Call Errors

2000-08-24 Thread Chaim Frenkel
> "JH" == Jarkko Hietaniemi <[EMAIL PROTECTED]> writes: JH> "The first operation done on the return value of open() shall be defined() JH> or you shall regret your pitiful existence."? (a flag on the scalar coming JH> from open that makes any other op than defined() to die and defined() clear

Re: RFC 88: What does catch "Foo" { } do?

2000-08-24 Thread Graham Barr
On Sun, Aug 20, 2000 at 09:23:20AM -0700, Peter Scott wrote: > At 10:14 AM 8/20/00 -0600, Tony Olekshy wrote: > >Graham Barr wrote: > > > > > > I am of the opinion that only a class name should follow catch. > > > If someone wants to catch based on an expression they should use > > > > > > catch

Re: RFC 88 (v2) Omnibus Structured Exception/Error Handling Mechanism

2000-08-24 Thread Jonathan Scott Duff
On Thu, Aug 24, 2000 at 10:47:45AM -0700, Peter Scott wrote: > > > But I initially wanted to do without the => ... unfortunately that would > > > require another keyword to handle the EXPR case and it didn't seem > > worth it. > > > >Not necessarily. > > > > catch { EXPR } { ... }

Re: RFC 88 (v2) Omnibus Structured Exception/Error Handling Mechanism

2000-08-24 Thread Peter Scott
At 12:50 PM 8/24/00 -0500, Jonathan Scott Duff wrote: > > How should the parser disambiguate > > > > my ($hash,%hash); > > try { ... } catch $hash { ... } > > > > ? But if we require the comma, we know it's parseable, because map can > do it. > >map is a slightly different animal because

Re: RFC 88 (v2) Omnibus Structured Exception/Error Handling Mechanism

2000-08-24 Thread Jonathan Scott Duff
On Thu, Aug 24, 2000 at 10:10:49AM -0700, Peter Scott wrote: > At 12:07 PM 8/24/00 -0500, Jonathan Scott Duff wrote: > > > catch Alarm => { ... } > > > catch Alarm, Error => { ... } > > > catch $@ =~ /divide by 0/ => { ... } > > > >The => here seems like useless syntax to me. > > Au c

Re: RFC 88 (v2) Omnibus Structured Exception/Error Handling Mechanism

2000-08-24 Thread Peter Scott
At 12:07 PM 8/24/00 -0500, Jonathan Scott Duff wrote: > > catch Alarm => { ... } > > catch Alarm, Error => { ... } > > catch $@ =~ /divide by 0/ => { ... } > >The => here seems like useless syntax to me. Au contraire... it emerged from our discussion of this case: > catch EXP

Re: RFC 88 (v2) Omnibus Structured Exception/Error Handling Mechanism

2000-08-24 Thread Jonathan Scott Duff
On Thu, Aug 24, 2000 at 03:37:59PM -, Perl6 RFC Librarian wrote: > =head1 TITLE > > Omnibus Structured Exception/Error Handling Mechanism Woohoo! > catch Alarm => { ... } > catch Alarm, Error => { ... } > catch $@ =~ /divide by 0/ => { ... } The => here seems like useless synta

Re: On the case for exception-based error handling.

2000-08-24 Thread Peter Scott
At 02:06 AM 8/24/00 -0600, Tony Olekshy wrote: >I just don't think that with with respect to the infrastructure >mechanism per se, "fatality" should have anything to do with it. >In the end, that's a judgement call; that's what we get paid the >big bux for ;-) I have reservations about the 'sever

Re: RFC 63 (v4) Exception handling syntax

2000-08-24 Thread Ilya Martynov
On Thu, 24 Aug 2000, Peter Scott wrote: PS> From the beginning of the posting you're quoting: PS> PS> This RFC has been merged into RFC 88. The text of the last version PS> prior to the merge is left below for archival purposes only. Anyone PS> interested in browsing this for historical reasons

Re: RFC 63 (v4) Exception handling syntax

2000-08-24 Thread Peter Scott
At 07:54 PM 8/24/00 +0400, Ilya Martynov wrote: >PRL> Exceptions are objects belonging to some C class. Cing >PRL> an exception creates the object; therefore, C above is just a >PRL> class name (possibly including some C<::>). >PRL> >PRL> The C function is just syntactic sugar for creating a new

Re: RFC 63 (v4) Exception handling syntax

2000-08-24 Thread Ilya Martynov
PRL> Exceptions are objects belonging to some C class. Cing PRL> an exception creates the object; therefore, C above is just a PRL> class name (possibly including some C<::>). PRL> PRL> The C function is just syntactic sugar for creating a new PRL> exception class;it merely amounts to C<@EXCEPTI

RFC 88 (v2) Omnibus Structured Exception/Error Handling Mechanism

2000-08-24 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Omnibus Structured Exception/Error Handling Mechanism =head1 VERSION Maintainer: Tony Olekshy <[EMAIL PROTECTED]> Date: 08 Aug 2000 Last Modified: 23 Aug 2000 Version: 2 Mailing List: [E

RFC 63 (v4) Exception handling syntax

2000-08-24 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Exception handling syntax =head1 VERSION Maintainer: Peter Scott <[EMAIL PROTECTED]> Date: 8 Aug 2000 Last-Modified: 23 Aug 2000 Version: 4 Mailing List: [EMAIL PROTE

Re: RFC 119v2: Object neutral error handling via exceptions

2000-08-24 Thread Tony Olekshy
Glenn Linderman wrote: > > Tony Olekshy wrote: > > > RFC 88 does say: > > > > finally { ... } > > > > Once the try block is entered, every finally block is > > guaranteed to be entered before the try statement completes, > > whether or not any exceptions have been raised since th

Re: On the case for exception-based error handling.

2000-08-24 Thread Tony Olekshy
Glenn Linderman wrote: > > Here's some code that returns one non-fatal error. I'd like to > change it to use the new RFC 88 mechanism. Please show me how. > I've included how to do it via RFC 119. Note that sub > really_delicate_code is documented that only one possible > non-fatal error can o

Re: On the case for exception-based error handling.

2000-08-24 Thread Tony Olekshy
Glenn Linderman wrote: > > Tony Olekshy wrote: > > > > You are oversimplifying by mixing the notions of exceptions > > and errors, whether you are aware of their difference or not. > > I am aware of the difference between errors and exceptions; > however, I firmly believe that exception handling