Leopold Toetsch wrote:
Roger Hale <[EMAIL PROTECTED]> wrote:

Leopold Toetsch wrote:

As @ARGS (or @IN_ARGS, @OUT_ARGS) is being stored in the context, and
that context is defacto the continuation, yes - a tail-call would
inherit this information.

But as each tail-call supplies a new @ARGS, how can this be the case?

We would have two parts in the context: @IN_ARGS, @OUT_ARGS. The C<tailcall> opcode can preserve that part with the return context.

It seems to me that both @IN_ARGS and @OUT_ARGS get used for other things (the tail-calls' arguments) in a chain of tail-calls. Consider this chain:


A calls B(@OUT_ARGS 1)[continuation: A*] in context c

B(@IN_ARGS 1)[c10n: A*] calls C(@OUT_ARGS 2)[c10n: A*]

C(@IN_ARGS 2)[c10n: A*] wants to know context c, as it's getting ready to return something. Neither @IN_ARGS (the arguments C received from B) nor @OUT_ARGS (the arguments of any call C may make) has this information, but the continuation (I propose) does; and this continues to be good for whoever wants to know: the return object holds the return context.

No?

regards,
 Roger

Reply via email to