[pypy-dev] Newb questions about ext module writing
arigo at tunes.org
Sat Jul 22 12:24:42 CEST 2006
On Fri, Jul 21, 2006 at 06:24:19PM -0700, Lenard Lindstrom wrote:
> In ctypes that is easy: use a bound method as the callback. Does that
> even work in rctypes?
I'm afraid not, and it's not obvious how this would be compiled to C
code, given that there is no kind of closure in ANSI C.
I don't see how to do that at all, actually :-( It's somehow a design
problem of the readline lib, which should in theory always pass an extra
void* "closure" arguments to callbacks...
It might be necessary to use hacks like a single global State instance,
storing the "space" the readline lib was initialized with, instead of
one State per space.
More information about the Pypy-dev