Mailing List Archive

continuationmodule.c preview
Howdy,

please find attached my latest running version of
continuationmodule.c which is really able to do continuations.
You need stackless Python 0.3 for it, which I just submitted.

This module is by no means ready.
The central functions are getpcc() and putcc.

Call/cc is at the moment to be done like:

def callcc(fun, *args, **kw):
cont = getpcc()
return apply(fun, (cont,)+args, kw)

getpcc(level=1) gets a parent's current continuation.
putcc(cont, val) throws a continuation.

At the moment, these are still frames (albeit special ones)
which I will change. They should be turned into objects which
have a link to the actual frame, which can be unlinked after
a shot or by hand. This makes it easier to clean up circular
references.

I have a rough implementation of this in Python, also a couple of
generators and coroutines, but all not pleasing me yet.

Due to the fact that my son is ill, my energy has dropped
a little for the moment, so I thought I'd better release
something now. I will make the module public when things
have been settled a little more.

ciao - chris

--
Christian Tismer :^) <mailto:tismer@appliedbiometrics.com>
Applied Biometrics GmbH : Have a break! Take a ride on Python's
Kaiserin-Augusta-Allee 101 : *Starship* http://starship.python.net
10553 Berlin : PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF
we're tired of banana software - shipped green, ripens at home