diff options
author | Vincent Pit <perl@profvince.com> | 2008-12-28 11:16:54 +0100 |
---|---|---|
committer | Vincent Pit <perl@profvince.com> | 2008-12-28 15:46:41 +0100 |
commit | d30e492cced9a7022652176a253f8f900679d9b0 (patch) | |
tree | 0a033351bd5ea72f0b3c4461ca73690fa18da76c /pp.h | |
parent | 3f0c5693d0a2100faf1b56983c7325096fcb0bda (diff) | |
download | perl-d30e492cced9a7022652176a253f8f900679d9b0.tar.gz |
Introduce SvCANEXISTDELETE in pp.h, which simplify the logic in pp_helem and pp_hslice
Diffstat (limited to 'pp.h')
-rw-r--r-- | pp.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -500,6 +500,15 @@ True if this op will be the return value of an lvalue subroutine =cut */ #define LVRET ((PL_op->op_private & OPpMAYBE_LVSUB) && is_lvalue_sub()) +#define SvCANEXISTDELETE(sv) \ + (!SvRMAGICAL(sv) \ + || ((mg = mg_find((const SV *) sv, PERL_MAGIC_tied)) \ + && (stash = SvSTASH(SvRV(SvTIED_obj(MUTABLE_SV(sv), mg)))) \ + && gv_fetchmethod_autoload(stash, "EXISTS", TRUE) \ + && gv_fetchmethod_autoload(stash, "DELETE", TRUE) \ + ) \ + ) + /* * Local variables: * c-indentation-style: bsd |