Regards,
Chris
Sylvain Wallez wrote:
Sylvain Wallez wrote:
<snip/>
Now back to the syntactic problem. I digged a bit and found the definition of the Scheme continuation at [1]. And although Rhino's continuations may follow that of Scheme, I see no real possible comparison between the respective syntaxes :
- Scheme's "call/cc" passes the continuation to its single parameter which is a procedure and executes this procedure. And the continuation (AFAIU) captures the state at its invocation point and not the state of the enclosing function.
- Rhino's "new Continuation()" captures the continuation of the enclosing function call and returns it, without further processing.
Update: after thinking further, I understand how Rhino and Scheme syntaxes relate. Rhino's function in which "new Continuation()" is called is actually the equivalent to the argument of call/cc.
But IMO this only enforces the fact that we don't *create* a continuation, but just *get* that of the enclosing function.
Sylvain