On Feb 19, 2008 7:43 AM, David Brown <[EMAIL PROTECTED]> wrote: > On Tue, Feb 19, 2008 at 07:14:07AM -0800, Bob La Quey wrote: > > >Not necessarily. Often we simply want to map things onto > >other structures. Sometimes that is easier to do recursively > >sometimes in some other way. Lots of code gets written that > >traverses XML in essentially a pattern matching mode without > >much reference to the tree structure. Certainly that is a > >natural way for a lot of the Perl guys to do things. > > True closures allow this mapping to be done naturally. The tree traversal > can be written recursively, and the results used linearly in another piece > of code. > > >> Without closures/continuations, there is no way to suspend the "stack" > >> information from a recursive set of calls to be resumed later (C, C++, > >> Java, for example). > > > >Well it has been a while but what about jump, setjump in C? > > setjmp in C lets you get out of the stack, but not back to where you were. The stack is saved in the environment. Doesn't that let you get back to where you were?
BobLQ -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
