Return-Path: Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 81426 invoked by uid 500); 17 Jul 2003 14:48:04 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 81321 invoked from network); 17 Jul 2003 14:48:03 -0000 Received: from vern.chem.tu-berlin.de (130.149.66.116) by daedalus.apache.org with SMTP; 17 Jul 2003 14:48:03 -0000 Received: from vern.chem.tu-berlin.de (localhost [127.0.0.1]) by vern.chem.tu-berlin.de (8.12.3/8.12.3/SuSE Linux 0.6) with ESMTP id h6HEm2GD013626 for ; Thu, 17 Jul 2003 16:48:02 +0200 Received: from localhost (stephan@localhost) by vern.chem.tu-berlin.de (8.12.3/8.12.3/Submit) with ESMTP id h6HEm2XF013623 for ; Thu, 17 Jul 2003 16:48:02 +0200 X-Authentication-Warning: vern.chem.tu-berlin.de: stephan owned process doing -bs Date: Thu, 17 Jul 2003 16:48:02 +0200 (CEST) From: Stephan Michels X-X-Sender: stephan@vern.chem.tu-berlin.de To: cocoon-dev Subject: RE: [Vote] Controller/Sitemap integration In-Reply-To: <002d01c34c6e$fbb4a7a0$05506bc2@WRPO> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > > So, here we have a DFA. > > > > The 'continuation' means to freeze the current state of the > > execution. The benefit of the continuations are that you have > > a history of the states, which you had traversed. And like a > > backtracking algorithm, you can go back to a previous state > > and follow another route. > > > > So, the answer is, it is sufficient to have the 'history of > > states' to take a new name like 'continuation' instead of > > simple 'state'? I think yes. > > Sorry, I don't think so. I'm not a specialist in Scheme but I think > there is a concept behind continuations and the general use for all > controllers in Cocoon would be misleading. Okay, to be sure I googled around, and found: http://www.cs.utexas.edu/users/wilson/schintro/schintro_141.html > call-with-current-continuation > > call-with-current-continuation is a very powerful control construct, > which can be used to create more conventional control constructs, like catch and > throw in Lisp (or setjmp and longjmp in C), or coroutines, and many > more. It is extremely powerful because it allows a program to manipulate its own > control "stack" so that procedure calls and returns needn't follow the > normal depth-first textual call ordering. > > Recall that we said [ WHERE? ] that Scheme's equivalent of an activation > stack is really a chain of partial continuations (suspension records), > and this chain is known as a full continuation. And since continuations are > immutable, they usually form a tree reflecting the call graph (actually, > only the non-tail calls). Normally, the parts of this tree that are not > in the current continuation chain are garbage, and can be garbage > collected. > > If you take a pointer to the current continuation, and put it in a live > variable or data structure, however, then that continuation chain will > remain live and not be garbage collected. That is, you can "capture" the > current state of the stack. It is not exactly what I want, but the core statement is 'A continuation is chain of partial continuations, or captured states of the stack' I think :) But maybe I'm wrong?! It's funny, but the whole continuation concept reminds me of the Tomita algorithm for simulating a GLR parser, which I currently working on ;-) http://www.cs.rhul.ac.uk/research/languages/publications/tomita_style_1.ps Stephan.