Leopold Toetsch <[EMAIL PROTECTED]> writes:
Piers Cawley <[EMAIL PROTECTED]> wrote:
When you make a full continuation with clone, can't you chase up its continuation chain and mark its reachable continuations (and only those continuations) as non recyclable? (This is one of the reasons I think that a Continuation should have an explicit copy of the continuation that was current when it was made, rather than relying on savetop/pushtopp to capture it.)
We need getting at the call chain anyway. But storing P1 elsewhere seems not to be the right thing. OTOH a subroutine using integers only would preserve it's context just with C<pushtopi>, if P1 is saved elsewhere. Your proposal smells like: the return continuation is normally hidden (i.e. not in any register, just in the context). Some opcode like C<get_current_cont> makes it available for backtracking or such.
That certainly makes sense to me; can anyone think of cases where having/making an explicit return continuation is a good thing?
I'm OK with moving the return continuation out of P1 and into somewhere else--I can even see throwing it on the control stack. (Or a special register, I can live with that as well)
Explicitly making the continuation is generally unneccessary--most calls ought to be callcc type calls, with plain call with user-supplied continuations for tail call situations or cases where one wants to do Evil Things. (Which is why it ought always be available)
--
Dan
--------------------------------------"it's like this"------------------- Dan Sugalski even samurai [EMAIL PROTECTED] have teddy bears and even teddy bears get drunk