Keep It Simple, Stupid | |
PerlMonks |
Re: Is recursion allowed?by clintp (Curate) |
on Mar 25, 2002 at 21:29 UTC ( [id://154232]=note: print w/replies, xml ) | Need Help?? |
Parrot allows you to push all of the string registers (pointers, actually) and integer registers onto their own private stack with pushs, pushi and restore them with pops and popi. (Numerics and PMC's with n/p respectively.) So you *can* write recursive subroutines after a fashion but effectively you make the entire register set local to each recursion:
local() for a particular registister can be emulated but it's a pain in the ass with something like:
The answer to your other question (asked in /msg) is that no, you can't peer down the stack or get the stack's depth at this time. However you can simulate peering into the stack just fine with the tools given.
In Section
Seekers of Perl Wisdom
|
|