help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: The fundamental concept of continuations


From: address@hidden
Subject: Re: The fundamental concept of continuations
Date: Tue, 09 Oct 2007 06:50:03 -0700
User-agent: G2/1.0

On Oct 9, 2:09 am, "." <address@hidden> wrote:
> On Tue, 09 Oct 2007 05:15:49 +0000, gnuist006 wrote:

> > (3) Is it present in python and java ?
>
> Certainly not Java, I dunno about Python.  I've never seen someone use
> them in Python, but the pythonistas seem to want to add everything but a
> decent lambda to their language so I wouldn't be surprised if someone had
> added a call/cc.  Ruby has it.
>

Continuations exist in all computer languages---actually, in anything
that executes code. The continuation is simply "what will happen for
the rest of the program execution." What might or might not exist is
an explicit linguistic mechanism to examine it, refer to the
continuation as a function, or to save it for later use.

> > (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.
>

The continuation is typically present in the stack, which contains all
the control-flow information needed to continue program execution from
this point. (I.e., the function call mechanism includes a step saving
the location of the instruction to execute when the function call is
complete, and any registers that it will restore after the function
returns because the function call might destroy them.)

How you save that continuation for later, possibly repeated, use from
a different location in the program is a different question.



reply via email to

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