http://www.perlmonks.org?node_id=249058


in reply to (Perl6) Groking Continuations

One explaination that I found helpufl was from Paul Graham

"In implementors' terms, a continuation is basically a program counter and a copy of the stack. You can invoke it like a function, and you're back where you were when the continuation was made. So you can return multiple times out the same code.

It's not bad form to use the same continuation more than once. That happens when you use continuations to do nondeterministic search, for example.

Another thing continuations are useful for is server-based apps, strangely enough. We used them extensively in Viaweb to fake subroutine-like behavior, though because we were using CL rather than Scheme we used fake continuations made out of closures."


-Lee

"To be civilized is to deny one's nature."

Replies are listed 'Best First'.
Re: Re: (Perl6) Groking Continuations
by stefp (Vicar) on Apr 09, 2003 at 15:27 UTC