Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python semi-coroutines

0 views
Skip to first unread message

Steven D. Majewski

unread,
Jul 24, 1998, 3:00:00 AM7/24/98
to

Since this has come up a couple of times, I finally dug thru
my files and found a few traces of this experiment and put
the files on <http://galen.med.virginia.edu/~sdm7g/Python/CO>

BTW: I considered the experiment a partial failure, because it
would not work to implement full-coroutines ( because ceval.c
is recursive and some of the state is implicit in the C calling
stack. ) but I believe it did successfully implement semi-coroutines
( i.e. Icon-like generators ) -- which seems to be all that
some folks want.

The mods were done to python-1.0.2
I haven't looked at how hard this would be to update to 1.5.1


--- README ---


There were experimental mods to python-1.0.2 to make frameobjects
into resumable continuations. ( put here for the curious and just
in case anyone wants to try a similar experiment with a more
current release. )

the files modified were frameobject.h and ceval.c

A new opcode was added for SUSPEND, but no new suspend statement
was added to the parser. I used a python disassembler/assembler
to change specific RETURN opcodes into SUSPENDs.
( various .py files here were hacked in that manner and used for testing.
)


co.txt & cont.semantics were the beginning of some notes on
various thread control issues.


py-co is part of the mailing list correspondence between me, Tim and Guido
that started me on that experiment.


More notes on this later when I find time.


- Steve Majewski <sd...@Virginia.EDU>

0 new messages