Continuations

Gregor palam_POOP_edes at softhome.net
Sun Jan 19 23:15:55 EST 2003


I came across an introduction to Stackless Python and continuations which 
piqued my interest. It gave the following example to illustrate how a 
continuation works:

def looptest(n):

    this = continuation.current()

    k = this.update(n)
      # continuation at "="
    if k:
        this(k-1)
        # resuming at "="
    else:
        del this.link


Can anyone tell what "this.update(n)" is, does, or represents? I 
understand the basic idea of what a continuation is, but that by itself 
isn't enough background for me to guess what all the terms mean.

Every introduction to continuations I've found either describes it using 
Scheme, which I haven't touched in a decade, and which I suspect most 
people haven't worked with at all, or re-uses the above Python example 
with little explanation.

Thanks,

Greg.

-- 
Be sure to correct my address when replying by e-mail.




More information about the Python-list mailing list