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

dTHX without a new scope?

Thread Next
From:
bulk 88
Date:
October 30, 2012 12:17
Subject:
dTHX without a new scope?
Message ID:
COL115-W527F0C2203B78CC99AA653DF620@phx.gbl

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About