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

Re: [perl #119049] referencing some variables hides others from PadWalkerstarting 5.17.2

Thread Previous | Thread Next
From:
Lukas Mai
Date:
August 1, 2013 06:07
Subject:
Re: [perl #119049] referencing some variables hides others from PadWalkerstarting 5.17.2
Message ID:
51F9FB19.1070907@gmail.com
On 01.08.2013 01:35, Ricardo SIGNES via RT wrote:
> On Tue Jul 30 16:05:09 2013, sprout wrote:
>> 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.)
>
> When did this become true in practice?
>
> It does not match up with what I take to be common definition of closures as enclosing a
> complete environment.  I agree that PadWalker is letting Perl programmers go beyond the realm
> of polite behavior, but let's put that aside.

Heh. I never think about "complete environments" or anything like that. 
My mental model works with variables only ("function X closes over 
variables A and B"). I'm surprised to learn the common definition works 
differently.

Just my 2 cents

-- 
Lukas Mai <plokinom@gmail.com>

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