[racket-dev] need help with pr-13350: readline busy polling vs callback fix?

From: Danny Yoo (dyoo at hashcollision.org)
Date: Sat Feb 9 14:43:53 EST 2013

Ok.  I can dodge this problem by re-routing the getc-like function
that readline uses with Racket-aware stuff.

(set-ffi-obj! "rl_getc_function" libreadline (_fun _pointer -> _int)
              (lambda (_)
                (define next-byte (read-byte))
                (if (eof-object? next-byte) -1 next-byte)))

If I do this, then everything appears to work fine.  I'll do that, and
avoid the fight with the input port buffering for now.

Posted on the dev mailing list.