develooper Front page | perl.perl5.porters | Postings from October 2012

dTHX without a new scope?

Thread Next
bulk 88
October 30, 2012 12:17
dTHX without a new scope?
Message ID:

This post is about a future interp patch. I want to portably declare the interp *, but not assign to it until later in the block. dTHX declares and initializes at the same time. Using dTHX would mean creating a new scope and large whitespace changes. I thought of doing "pTHX; some(); code(); aTHX = PERL_GET_THX; more(); code();" but I think aTHX = PERL_GET_THX will be a compile error on no PERL_IMPLICIT_CONTEXT. So, without using PERL_IMPLICIT_CONTEXT ifdefs everywhere, is there already a way to portably defer fetching of the context?

If not, I propose to make such an API. I dont know yet what it should look like. I noticed gTHX is unused. aTHX is defined to "void" on no PERL_IMPLICIT_CONTEXT. dTHX has existing meaning which can not be changed.
Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About