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--)
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 C blocks used to; if this is deemed inappropr
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
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->
> "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>
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; }
> > >
> > > Coul
[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
> "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
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 f
> "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> (whic
Could you tell me why you would want two finallys?
Why not put them into one?
> "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
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
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
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
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
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 (
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)
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
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
19 matches
Mail list logo