[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: So, what the heck is a continuation anyway?



At 03:39 PM 12/10/2001 -0500, Matthias Felleisen wrote:

>   > X-Sender: dan@pop.sidhe.org
>   > Date: Mon, 10 Dec 2001 15:37:11 -0500
>   > From: Dan Sugalski <dan@sidhe.org>
>   > Cc: "Seth Gordon" <sethg@ropine.com>, ll1-discuss@ai.mit.edu
>   > Content-Type: text/plain; charset="us-ascii"; format=flowed
>   > Sender: owner-ll1-discuss@ai.mit.edu
>   > Precedence: bulk
>   >
>   > At 10:11 AM 12/10/2001 -0500, Jeremy Hylton wrote:
>   > > >>>>> "DS" == Dan Sugalski <dan@sidhe.org> writes:
>   > >
>   > >   DS> can I get a continuation object/marker from within A and pass it
>   > >   DS> to B, which then triggers it and returns to A even though I've
>   > >   DS> unwound the stack frames for A?
>   > >
>   > >Sure.
>   > >
>   > >You can invoke the continuation and return through A an arbitrary
>   > >number of times.
>   >
>   > Hmmm. That means I need to snapshot the stack frames and the 
> scratchpads.
>   > Doable.
>
>Careful, you don't want to crash as often as Stackless Python.
>
>Unless you heap allocate all values, copying the stack naively
>will be a problem.

Perl's been stackless, in the "Stackless Python" sense for pretty much its 
entire life, so that's not a big issue. Parrot's got more stacks than you 
can shake a stick at (unless you've a really, really big stick) so I'm not 
really worried, and we need to do more or less this sort of thing for 
closures anyway, so...

The biggest issues in that regard are all bookkeeping ones, so I expect it 
won't be a big problem. (Instead, like many bookkeeping problems, I expect 
it to be small, never-ending, and painfully annoying :)

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk