[Seaside] Seaside Internals

Stephen Pair stephen at pairhome.net
Mon Sep 8 10:55:25 CEST 2003


Avi Bryant wrote:

>On Sat, 6 Sep 2003, Lukas Renggli wrote:
>
>  
>
>>As far as I understand you are terminating the old request in
>>Continuation>>value: v. Having a look at the implementation of
>>Continuation>>terminate: aContext raises a questions: Do you unwind the
>>stack (e.g. evaluate the ensure-blocks) when terminating the evaluation
>>of a continuation? It doesn't seem so (why not?), but I might have
>>misunderstood.
>>    
>>
>
>No, what you're looking for is WAProcessMonitor>>critical:.
>Continuation>>terminate: is in fact what unwinds the stack, although it
>doesn't evaluate ensure blocks as it goes.  Whether or not it *should* is
>an open question, and the source of some controversy in the Scheme world -
>see, for example,
>http://www.nhplace.com/kent/PFAQ/unwind-protect-vs-continuations.html or
>http://www.ccs.neu.edu/home/dorai/uwcallcc/uwcallcc.html .
>
>Can you give an example of some Seaside code with an #ensure: , and when
>you think the #ensure: ought to be evaliated?
>

Those links seem to only argue in favor of having continuations evaluate 
an unwind behavior.  Where are the arguments against?  I can't think of 
any reason why a normal use of continuations shouldn't invoke the unwind 
behavior of the calling (and terminating) stack.  In my opinion, any 
flow control contructs (non local returns, exception handling, 
continuations, etc) should honor requests to #ensure: (and friends).

Btw, what about changing the protocol of continuations from #value to 
#resume (I think the arguments in favor of this change were that there 
is more of an expectation of non-normal flow control happening with 
#resume)?  Also, I'd like to see another method on a continuation that 
will create and schedule another process to resume a continuation (and 
leave the current stack alone)...maybe that's already there though.  
Something like:

fork

    [self resume] fork

One of these days, we'll have to think about reconciling continuations 
and exception handling (where an exception would hold a continuation and 
a handler would run in a different branch off the same stack as the 
continuation (instead of being lopped onto the bottom of the stack)).

- Stephen



More information about the Seaside mailing list