Tassilo von Parseval wrote: > > for perl >= 5.9.1 : > > > > #define dUNDERBAR I32 padoff_du = pad_findmy("$_") > > #define UNDERBAR ((padoff_du == NOT_IN_PAD \ > > || PAD_COMPNAME_FLAGS(padoff_du) & SVpad_OUR) \ > > ? DEFSV : PAD_SVl(padoff_du)) > > > > For older perls : > > > > #define dUNDERBAR /**/ > > #define UNDERBAR DEFSV > > Looks convenient. You are the lexical underbar guru, so I also trust you > that it's correct. If it isn't yet in blead, it should go there (and > also into Devel::PPPort).
I have now added the macros in bleadperl as change #22819. > > Defining a dUNDERBAR macro has the advantage that the pad_findmy lookup > > is done only once. In a XSUB lexical scoping isn't likely to change. > > And even if it happens, this can be handled easily. > > dUNDERBAR; > ... > { > ENTER; > dUNDERBAR; > ... > LEAVE; > } > > Btw, we can't rename dUNDERBAR to wUNDERBAR (as a little candy for the > German XS writers), can we? ;-) Mind you, my german-speaking skills are very poor, but I can't help thinking about this word every time I hear the idiom "underbar".