diff options
-rw-r--r-- | pad.c | 6 | ||||
-rw-r--r-- | pad.h | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -85,7 +85,8 @@ SvOURSTASH slot pointing at the stash of the associated global (so that duplicate C<our> declarations in the same package can be detected). SvUVX is sometimes hijacked to store the generation number during compilation. -If SvFAKE is set on the name SV, then that slot in the frame AV is +If PADNAME_OUTER (SvFAKE) is set on the +name SV, then that slot in the frame AV is a REFCNT'ed reference to a lexical from "outside". In this case, the name SV does not use xlow and xhigh to store a cop_seq range, since it is in scope throughout. Instead xhigh stores some flags containing info about @@ -96,7 +97,8 @@ cloning quicker. If the 'name' is '&' the corresponding entry in the PAD is a CV representing a possible closure. -(SvFAKE and name of '&' is not a meaningful combination currently but could +(PADNAME_OUTER and name of '&' is not a +meaningful combination currently but could become so if C<my sub foo {}> is implemented.) Note that formats are treated as anon subs, and are cloned each time @@ -221,6 +221,9 @@ Whether this is an "our" variable. =for apidoc m|HV *|PADNAME_OURSTASH The stash in which this "our" variable was declared. +=for apidoc m|bool|PADNAME_OUTER|PADNAME pn +Whether this entry belongs to an outer pad. + =for apidoc m|HV *|PADNAME_TYPE|PADNAME pn The stash associated with a typed lexical. This returns the %Foo:: hash for C<my Foo $bar>. @@ -284,6 +287,7 @@ Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL() #define PADNAME_UTF8(pn) !!SvUTF8(pn) #define PADNAME_isOUR(pn) !!SvPAD_OUR(pn) #define PADNAME_OURSTASH SvOURSTASH(pn) +#define PADNAME_OUTER !!SvFAKE(pn) #define PADNAME_TYPE(pn) (SvPAD_TYPED(pn) ? SvSTASH(pn) : NULL) |