Re: Continuations for fun and profit

2002-07-08 Thread Nicholas Clark
On Mon, Jul 08, 2002 at 04:54:16PM -0400, Dan Sugalski wrote: Pretty simple. (For illustrative purposes) To do that with continuations, it'd look like: $cont = take_continuation(); if ($foo) { $foo--; invoke($cont); } take_continuation() returns a continuation

Re: Continuations for fun and profit

2002-07-08 Thread Peter Scott
At 04:54 PM 7/8/02 -0400, Dan Sugalski wrote: A continuation is a sort of super-closure. Like a closure it captures its lexical variables, so every time you use it, you're referring to the same set of variables, which live on until the continuation's destroyed. This works because the variables

Re: Continuations for fun and profit

2002-07-08 Thread Dan Sugalski
could serialize a continuation, you could freeze your program state to disk and restore it later? Cool, makes for easy checkpoint/restarts. Yep. But serializing continuations is either tough, or not completely doable, since programs tend to have handles on things outside their direct control

Re: Continuations for fun and profit

2002-07-08 Thread Dan Sugalski
At 10:24 PM +0100 7/8/02, Nicholas Clark wrote: On Mon, Jul 08, 2002 at 04:54:16PM -0400, Dan Sugalski wrote: Pretty simple. (For illustrative purposes) To do that with continuations, it'd look like: $cont = take_continuation(); if ($foo) { $foo--; invoke($cont

Re: Continuations for fun and profit

2002-07-08 Thread Ted Ashton
Thus it was written in the epistle of Peter Scott, So if you could serialize a continuation, you could freeze your program state to disk and restore it later? Cool, makes for easy checkpoint/restarts. I think that that would be true only if *all* data was maintained in those scratchpads

<    1   2