Piers Cawley <[EMAIL PROTECTED]> wrote:

> I could be wrong here, but it seems to me that having a special
> 'tailinvoke' operator which simply reuses the current return
> continuation instead of creating a new one would make for rather faster
> tail calls than fetching the current continuation out of the interpreter
> structure, then invoking the target sub with with this new
> continuation (ISTM that doing it this way means you're going to end up
> doing a chunk of the work of creating a new return continuation anyway,
> which rather defeats the purpose.)

Yep, that's true. We already have (unimplemented) C<tailcallmethod>
opcodes. A plain C<tailcall> for functions is still missing. Anyway, if
the current continuation has its location in the interpreter context,
its simple to implement these opcodes.
If a real continuation object is constructed or not is invisible then
and can be considered as an implementation detail.

Anyway, I think that the current continuation will be mostly invisible
except in code like your backtracking example, where you explicitely
request the (call-with-current-continuation ...).

leo

Reply via email to