Re: RFC 88: Possible problem with shared lexical scope.

2000-08-20 Thread Tony Olekshy
Peter Scott wrote: > > > > Tony Olekshy wrote: > > > > > > > try { fragile(); } > > > > catch { my $caught = 1; } > > > > finally { $caught and ... } > > > > > It should work as though each pair of } ... { in between try { and > the end of the last finally or catch block isn't th

Re: RFC 88: Possible problem with shared lexical scope.

2000-08-20 Thread Peter Scott
At 06:48 PM 8/20/00 -0600, Tony Olekshy wrote: >Dave Rolsky wrote: > > > > Tony Olekshy wrote: > > > > > try { fragile(); } > > > catch { my $caught = 1; } > > > finally { $caught and ... } > > > > If all those pieces were in the same scope I think it would still > > work like th

Re: RFC 88: Possible problem with shared lexical scope.

2000-08-20 Thread Tony Olekshy
Dave Rolsky wrote: > > Tony Olekshy wrote: > > > try { fragile(); } > > catch { my $caught = 1; } > > finally { $caught and ... } > > If all those pieces were in the same scope I think it would still > work like this (in Perl5-ish code): > > { > try { fragile(); # It must be

Re: RFC 88: Possible problem with shared lexical scope.

2000-08-20 Thread Dave Rolsky
On Sun, 20 Aug 2000, Tony Olekshy wrote: > That would be nice. But does this mean that in the following > case: > > try { fragile(); } > catch { my $caught = 1; } > finally { $caught and ... } > > storage for $caught is allocated and initialized to undef at the > beginning of

Re: RFC 88: Possible problem with shared lexical scope.

2000-08-20 Thread Tony Olekshy
Dave Rolsky wrote: > > On Sun, 20 Aug 2000, Tony Olekshy wrote: > > > try { my $p = P->new; my $q = Q->new; ... } > > finally { $p and $p->Done; } > > finally { $q and $q->Done; } > > > > If P->new throws, then the second finally is going to test > > $q, but it's not "in scope" yet (

Re: RFC 88: Possible problem with shared lexical scope.

2000-08-20 Thread Dave Rolsky
On Sun, 20 Aug 2000, Tony Olekshy wrote: > Shared: > > try { my $p = P->new; my $q = Q->new; ... } > finally { $p and $p->Done; } > finally { $q and $q->Done; } > > If P->new throws, then the second finally is going to test > $q, but it's not "in scope" yet (its my hasn't been seen)

RFC 88 v2 draft 5 is available via http.

2000-08-20 Thread Tony Olekshy
This version will be published after Peter Scott gets a chance to review the last days' changes (he's co-author now), and I make any adjustments necessitated by your reviews, dear reader ;-) Formatted: http://www.avrasoft.com/perl/rfc/rfc88v2d5.htm POD as text: http://www.avrasoft.com/perl/rfc/

Re: RFC 88: Possible problem with shared lexical scope.

2000-08-20 Thread Glenn Linderman
Tony Olekshy wrote: > Non-shared: > > my ($p, $q); > try { $p = P->new; $q = Q->new; ... } > finally { $p and $p->Done; } > finally { $q and $q->Done; } > > Shared: > > try { my $p = P->new; my $q = Q->new; ... } > finally { $p and $p->Done; } > finally { $q and $q->Do

RFC 88: Possible problem with shared lexical scope.

2000-08-20 Thread Tony Olekshy
Non-shared: my ($p, $q); try { $p = P->new; $q = Q->new; ... } finally { $p and $p->Done; } finally { $q and $q->Done; } Shared: try { my $p = P->new; my $q = Q->new; ... } finally { $p and $p->Done; } finally { $q and $q->Done; } If P->new throws, then the second f

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

2000-08-20 Thread Tony Olekshy
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 () { > > > } > > > else { > > >

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

2000-08-20 Thread Peter Scott
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 { > > if () { > > } > > else { > > # rethrow the error >

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

2000-08-20 Thread Tony Olekshy
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 () { > } > else { > # rethrow the error > } > } Then you will be glad to know that RFC 88, in the n

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

2000-08-20 Thread Graham Barr
On Fri, Aug 18, 2000 at 11:04:03PM -0600, Tony Olekshy wrote: > As currently promulgated, catch "Foo" {} will always catch, > because "Foo" is true. Will this cause confusion for developers > who meant to say catch Foo {}? And what happens when someone > says catch "Foo", "Bar" {}? > > We can't