Front page | perl.perl5.porters |
Postings from October 2014
Re: Shared padlists
Thread Previous
|
Thread Next
From:
Father Chrysostomos
Date:
October 29, 2014 12:47
Subject:
Re: Shared padlists
Message ID:
20141029124709.13124.qmail@lists-nntp.develooper.com
I wrote:
> Wait. I'm not thinking straight.
Ahem. I was *still* not thinking straight.
> According to what I was thinking before, a boolean would be suffi-
> cient, because you just have to check if some other sub is using the
> padlist already to decide whether to clone the whole thing.
>
> But I've been stuck mentally associating CvDEPTH with the CV itself.
>
> If CvDEPTH goes inside the padlist, then it may not be necessary for a
> sub to clone a padlist that is already active. Given two subrefs $a
> and $b that come from the same closure prototype, $a->() will use pad
> 1, and if it calls $b, $b will use pad 2, because it will already have
> a depth of 1, even though it is not being called.
We can't do that for closures, because closures by definition need to
capture outer lexicals. We could still use this approach for fixing
blessed anonymous subs.
Thread Previous
|
Thread Next