develooper Front page | perl.perl5.porters | Postings from July 2013

[perl #119049] referencing some variables hides others from PadWalker starting 5.17.2

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
July 31, 2013 00:55
Subject:
[perl #119049] referencing some variables hides others from PadWalker starting 5.17.2
Message ID:
rt-3.6.HEAD-2552-1375232089-227.119049-15-0@perl.org
On Tue Jul 30 17:43:09 2013, demerphq wrote:
> On 31 July 2013 01:05, Father Chrysostomos via RT
> > In short: closures close over variables, not lexical scopes, unless
> > string eval is involved.  (So one can work around this by including eval
> > "" in the sub.)
> >
> > I don’t think anything needs fixing here, so I am rejecting the ticket.
> >
> 
> IMO if you have to include eval "" in your sub then there is something
> else wrong too.

How so?  PadWalker is peeking at perl internals and can see
implementation details.

In the presence of eval, perl cannot know which variables the sub is
going to close over, so it closes over all of them.  In its absence it
closes over only those it has to.

What I am saying is that PadWalker is a bit like B:  If the internals
change, then what you see through that interface changes, because there
is no abstraction.  We shouldn’t have to maintain that type of
compatibility.

> 
> I'm not saying this argues against closing the ticket, but right now
> it is not clear to me that it should be.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: rejected
https://rt.perl.org:443/rt3/Ticket/Display.html?id=119049

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About