Re: Continuations for fun and profit

2002-07-09 Thread Peter Haworth
On Mon, 8 Jul 2002 16:54:16 -0400, Dan Sugalski wrote: > while ($foo) { > $foo--; > } > > Pretty simple. (For illustrative purposes) To do that with > continuations, it'd look like: > > $cont = take_continuation(); > if ($foo) { >

Re: Continuations for fun and profit

2002-07-09 Thread Ted Zlatanov
On Mon, 8 Jul 2002, [EMAIL PROTECTED] wrote: > Yep. But serializing continuations is either tough, or not > completely doable, since programs tend to have handles on things > outside their direct control like filehandles, sockets, database > connections, and suchlike things

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

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();

Re: Continuations for fun and profit

2002-07-08 Thread Dan Sugalski
aking it, in effect, as if we'd never really >>left the spot we took the continuation at. And, like normal >>closures, we can do this from wherever we like in the program. > >So if you could serialize a continuation, you could freeze your >program state to disk and rest

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 variab

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); >} >

Re: Continuations for fun and profit

2002-07-08 Thread David M. Lloyd
On Mon, 8 Jul 2002, 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_continuati

Re: The Past, Present and Future of Continuations (was: Perl 6Summary)

2002-07-08 Thread Dan Sugalski
At 2:43 PM +0100 7/8/02, Andy Wardley wrote: >A short time ago, in a nearby thread, Larry Wall wrote: >> Perhaps we should just explain continuations in terms of time travel. > >Funny. I wrote a message to this effect the other night, but decided >not to send it (too tired

Continuations for fun and profit

2002-07-08 Thread Dan Sugalski
e invoke a continuation, we put in place both the variables and call scratchpads, making it, in effect, as if we'd never really left the spot we took the continuation at. And, like normal closures, we can do this from wherever we like in the program. The nice thing about continuati

The Past, Present and Future of Continuations (was: Perl 6 Summary)

2002-07-08 Thread Andy Wardley
A short time ago, in a nearby thread, Larry Wall wrote: > Perhaps we should just explain continuations in terms of time travel. Funny. I wrote a message to this effect the other night, but decided not to send it (too tired to decide if I was talking sense or nonsense). I was about to prop

<    1   2