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

2000-08-22 Thread Chaim Frenkel
"DR" == Dave Rolsky [EMAIL PROTECTED] writes: DR On 22 Aug 2000, Chaim Frenkel wrote: Could you tell me why you would want two finallys? Why not put them into one? TO my ($p, $q); TO try { $p = P-new; $q = Q-new; ... } TO finally { $p and $p-Done; } TO finally { $q and $q-Done; } DR

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

2000-08-22 Thread Tony Olekshy
Chaim Frenkel wrote: Tony Olekshy wrote: If you write this: try { my $p = P-new; my $q = Q-new; } finally { $p and $p-Done; $q and $q-Done; } what happens if both constructors succeed, but $p-Done dies? try {

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

2000-08-22 Thread Chaim Frenkel
"TO" == Tony Olekshy [EMAIL PROTECTED] writes: Syntactically the have to be next to one another, so write them as one. TO If you write this: TO try { my $p = P-new; TO my $q = Q-new; TO } TO finally { $p-Done; TO $q-Done; TO } TO what

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

2000-08-22 Thread Brust, Corwin
[snip] -Original Message- From: Chaim Frenkel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 22, 2000 12:43 AM To: Tony Olekshy Cc: [EMAIL PROTECTED] Subject: Re: RFC 88: Possible problem with shared lexical scope. Could you tell me why you would want two finallys? Why not put them

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

2000-08-22 Thread Tony Olekshy
Chaim Frenkel wrote: Dave Rolsky wrote: Chiam Frenkel wrote: Tony Olekshy wrote: try { my $p = P-new; my $q = Q-new; ... } finally { $p and $p-Done; } finally { $q and $q-Done; } Could you tell me why you would want two finallys?

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

2000-08-22 Thread Peter Scott
At 12:28 PM 8/22/00 -0700, I wrote: The issue is not whether it is possible but whether it is desirable. Chaim thought that the P5 continue block scope issue was 'fixed' by Gurusamy at some point and this is almost certainly correct. Observe: % perl5.003 -Mstrict -we 'my $x = 2; while($x--)

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

2000-08-22 Thread Peter Scott
At 11:59 PM 8/20/00 -0600, Tony Olekshy wrote: RFC 88v2d6 now leaves in shared lexical scope and says the following under ISSUES + Lexical Scope: If it is not possible to have try, catch, and finally blocks share lexical scope (due, perhaps, to the vagaries of stack unwinding),

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

2000-08-22 Thread Tony Olekshy
Peter Scott wrote: Given that even though we know the shared scope could be implemented, the implementors may prefer not to do it. I would therefore reword: We would prefer that the blocks share a common lexical scope in the way that Ccontinue blocks used to; if this is deemed

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

2000-08-21 Thread Dave Rolsky
On 22 Aug 2000, Chaim Frenkel wrote: Could you tell me why you would want two finallys? Why not put them into one? TO my ($p, $q); TO try { $p = P-new; $q = Q-new; ... } TO finally { $p and $p-Done; } TO finally { $q and $q-Done; } Presumably because all finally blocks

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

2000-08-21 Thread Chaim Frenkel
Could you tell me why you would want two finallys? Why not put them into one? chaim "TO" == Tony Olekshy [EMAIL PROTECTED] writes: TO Non-shared: TO my ($p, $q); TO try { $p = P-new; $q = Q-new; ... } TO finally { $p and $p-Done; } TO finally { $q and $q-Done; } TO Shared:

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

2000-08-21 Thread Chaim Frenkel
"PS" == Peter Scott [EMAIL PROTECTED] writes: PS However, my memory as to what the current perl behavior is was faulty; PS continue blocks do *not* share the lexical scope of their attached loop PS blocks. I was misremembering the caveat at the end of this part of perlsyn PS (which says the

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 finally

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). Or is it?

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 Italian }

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-Done; } In RFC

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 there. Storage for