in reply to Re^3: Callstack manipulation?
in thread Callstack manipulation?

Hi plobsing,

thanks a lot for your help! : )

I should mention that Moritz already implemented gather&take using coro http://search.cpan.org/~moritz/Perl6-GatherTake/ ...but he doesn't give the impression to be very convinced about the outcome.

Nevertheless I just wanted to give a motivation for a more fundamental question:

Are there any opcodes allowing to manipulate the call stack?

Popping and pushing the stack gives an approach to a whole bunch of Assembler techniques (and pitfalls of course ;)

Replies are listed 'Best First'.
Re^5: Callstack manipulation?
by LanX (Saint) on Nov 03, 2008 at 01:53 UTC
    > Are there any opcodes allowing to manipulate the call stack?

    Ok, at least one can manipulate the stack with XS, I found some examples in Advanced Perl Programming, describing macros to do so!

    8 )

    (over 10 years old but still an interesting read *)

    UPDATES:

  • Concerning coro: AFAIS the coroutines get separated lexical variable spaces, complicating a Gather/Take-Algorithm to access "surrounding" variables.
  • * I was talking about the first edition!