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

Re: [PATCH] C Callbacks, try #3

Thread Previous | Thread Next
Simon Cozens
August 27, 2001 12:05
Re: [PATCH] C Callbacks, try #3
Message ID:
On Fri, Aug 24, 2001 at 04:26:14PM -0500, David M. Lloyd wrote:
> > There was some discussion on #perl a few days ago about lexically
> > scoped runops functions which didn't seem to come up against any
> > compelling reasons why this couldn't or shouldn't be done.
> That sounds neat, but how would you do it?

Hmm. I'd do it by fiddling the op tree. I'd find the nearest last,
(or similar) and do something like this:

    OP* afterlast = last->next;
    last->next = NULL;
    PL_op = last;
    last->next = afterlast;

It's similar to the way constant folding works, sort of.

Well, that's how I'd do it. Don't let me stop you doing it another way,
though. :)


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