Dan Sugalski <[EMAIL PROTECTED]> wrote: >> $P1 = interpinfo .INTERPINFO_CURRENT_CONT >> $P1 = clone $P1 >> >>I'm still inclined to make this sequence an opcode, though. The >>cloning is still necessary, as the return continuation is returned.
> Hrm. I think the returned continuation should be usable without > cloning. If we need to clone it it should be part of the continuation > fetching. Probably yes[1]. Eventually we can get rid of the return continuation object. But that's not easy as we have "invoke sub_obj" too, which uses an existing continuation in P1. Additionally there's already a lot of code around that just does "invoke P1". To disambiguate call and return for the case "plain subroutine", we would need a "returncc" opcode, that use the information in the context to return as we now do with P1. A sequence: invokecc ... returncc doesn't need a P1 object, it just needs a pointer in the Sub context to the caller's context. [1] There'is the case of pure introspection, where cloning isn't needed, *if* the return continuation isn't abused. Could be dangerous, though. leo