develooper Front page | perl.perl5.porters | Postings from August 2001

RE: [PATCH List::Util] fix stack/scoping problems

Thread Previous | Thread Next
Wilson, Doug
August 21, 2001 12:09
RE: [PATCH List::Util] fix stack/scoping problems
Message ID:

Cool, I tried to do the same thing with (PUSH|POP)BLOCK, but
I just didn't get the magic right :)

I know I'm probably living dangerously, but does anyone think
there'd be problems or significant benefit with only calling
(PUSH|POP)BLOCK once, rather than for each list element?
This seems to work also (from List::Util::first after applying
Robin's patch):

PUSHBLOCK(cx, CXt_BLOCK, SP);  # Added
for(index = 1 ; index < items ; index++) {
    GvSV(PL_defgv) = ST(index);
    PL_op = reducecop;
    #PUSHBLOCK(cx, CXt_BLOCK, SP); #Deleted
    #POPBLOCK(cx,PL_curpm);     #Deleted
    SP = newsp;
    if (SvTRUE(*PL_stack_sp)) {
      POPBLOCK(cx,PL_curpm);  # Added
      ST(0) = ST(index);
POPBLOCK(cx,PL_curpm); # Added

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About