ANN: Stackless Python 0.2
mwh21 at cam.ac.uk
Tue Jun 15 21:21:51 EDT 1999
neelk at brick.cswv.com (Neel Krishnaswami) writes:
> In article <376636EA.84240129 at appliedbiometrics.com>,
> Christian Tismer <tismer at appliedbiometrics.com> wrote:
> >Neel Krishnaswami wrote:
> >[Stackless Python 0.2]
> >> This is very neat, and you are completely deranged. I know just
> >> enough to know that I should cheer you on, mind, but I'll try to
> >> cheer loudly. Feel free to make an announce when you add coroutine
> >> support. Please? :)
> >Thanks :-)
> >Sure I will. I'd like to know wether my binary works ok for you.
> >You might also try a recursive function, it should raise an
> >exception after 29999 recursions (just to have *a* limit).
> Unfortunately, I couldn't get it to build (I'm on a Linux machine).
> I tried copying the files from the stackless distribution into the
> appropriate places in the Python source distribution, but I get
> the following error:
> $ gcc -g -O2 -I./../Include -I.. -DHAVE_CONFIG_H -c myreadline.c -o myreadline.o
> In file included from ../Include/Python.h:38,
> from myreadline.c:42:
> ../Include/patchlevel.h:69: parse error before `5'
> ../Include/patchlevel.h:69: stray '\' in program
> ../Include/patchlevel.h:70: stray '\' in program
> ../Include/patchlevel.h:71: stray '\' in program
> [plus more cascading errors as a result of this]
> Apparently gcc is not liking this:
> /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
> Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */
> #define PY_VERSION_HEX ((PY_MAJOR_VERSION << 24) | \
> (PY_MINOR_VERSION << 16) | \
> (PY_MICRO_VERSION << 8) | \
> (PY_RELEASE_LEVEL << 4) | \
> (PY_RELEASE_SERIAL << 0))
> The '5' in the "parse error before '5'" is the PY_MICRO_VERSION; the
> macro looks ok to me, but I haven't used C to any great extent in
> literally years. Am I making some very naive mistake?
Ah, got this one; Naughty Chris's archive contains files with CRLF
line endings. This doesn't bother gcc in most places, except where a
backslash is used to continue a line, when it gets the screaming
heebie-jeebies. Eliminate the nasty ^M's and it all gets better. Also
diff stops reporting that every single line in the file as changed,
which was confusing me.
It doesn't seem to link yet. Oh well, it's late and I'm going to bed.
I can send you a diff against cvs's latest if that would help.
> >I'm just undecided on the design. There are a couple of
> >different coroutine interfaces. You find them for instance in
> >Scheme, in Modula II, some Oberons, Icon, and in Tim Peter's
> >example which I added to my stackless archive.
> >Do you have a proposal?
> Not really; all I know is a little Scheme, and that part of my brain
> is telling me that "coroutines are just closures over continuations."
> Fortunately, I'm still able to realize that that's probably the
> wrong interface. :)
More information about the Python-list