[Top][All Lists]

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

Re: The fundamental concept of continuations

From: Barb Knox
Subject: Re: The fundamental concept of continuations
Date: Tue, 09 Oct 2007 18:59:28 +1300
User-agent: MT-NewsWatcher/3.4 (PPC Mac OS X)

In article <address@hidden>,
 address@hidden wrote:

> Again I am depressed to encounter a fundamentally new concept that I
> was all along unheard of.

Don't be depressed about that.  There are countless concepts out there 
they you haven't yet heard of.

> Its not even in paul graham's book where i
> learnt part of Lisp. Its in Marc Feeley's video.
> Can anyone explain:
> (1) its origin

Lambda calculus.  Instead of function A returning to its caller, the 
caller provides an additional argument (the "continuation") which is a 
function B to be called by A with A's result(s).  In pure "continuation 
style" coding, nothing ever "returns" a result.

It is easy to mechanically transform normal function-style lambda 
calculus into continuation-style, but the reverse is not so.

> (2) its syntax and semantics in emacs lisp, common lisp, scheme
> (3) Is it present in python and java ?

Java, sort of.  For example, the Run interface.
Python, I don't know.

> (4) Its implementation in assembly. for example in the manner that
> pointer fundamentally arises from indirect addressing and nothing new.
> So how do you juggle PC to do it.

You can have a "spaghetti stack", or keep continuation data-structures 
in the heap.

> (5) how does it compare to and superior to a function or subroutine
> call. how does it differ.

This sounds like homework.  What do you have so far?

> Thanks a lot.
> (6) any good readable references that explain it lucidly ?


|  BBB                b    \     Barbara at LivingHistory stop co stop uk
|  B  B   aa     rrr  b     |
|  BBB   a  a   r     bbb   |    Quidquid latine dictum sit,
|  B  B  a  a   r     b  b  |    altum viditur.
|  BBB    aa a  r     bbb   |   

reply via email to

[Prev in Thread] Current Thread [Next in Thread]