Subject: [clisp-list] read-char-no-hang broken?

From: Douglas Philips <[email-masked]>
Date: Tue Jul 1 15:01:05 2003

Hey all,
   I just searched the sourceforge bugs database, and either didn't find 
anything or didn't know what esoteric term to search for...

   What I've noticed/been-highly-irritated by is that that when I use
		(ext:with-keyboard
			...
			... (read-char-no-hang ext:*keyboard-input*)
			...)
It indeed doesn't hang so long as I don't type anything. But the first 
character I type not only causes it to hang, but is never returned! 
read-char on ext:*keyboard-input* doesn't seem to have this problem.
Has anyone else seen this? I've repro'd it on 2.29 (MacOS/X) and 2.30 
(Red Hat 8 and Red Hat 9)

I figured I'd ask before submitting a bug report (ok, and vent a little 
bit too). Of course last I tried, I couldn't build the cvs head on my 
Mac (error messages long since lost and forgotten)...

-Doug
P.S. Here is the code that (infinite loop warning, your terminal will 
be in unbreakable mode!) shows it (for me):

(defun brokey-input ()
     (let (c)
         (ext:with-keyboard
             (do () (nil)
                 (write-char #\.)
                 (finish-output)
                 (setq c (read-char-no-hang ext:*keyboard-input*))
                 (if (not (null c))
                     (progn (format t "~A~%" c) (finish-output)))))))

When I run (brokey-input) what I see is a flow of dots UNTIL I hit the 
first key. Then the flow stops. When I then hit another key (same or 
different), that key is returned, I get one more dot (#\.) and then the 
program stops waiting for the next character.
(If you comment out the (if (not...)) code, it still stops printing 
dots, so format isn't interfering...

---

From: Sam Steingold <[email-masked]>
Date: Wed Jul 2 07:37:03 2003

> * In message <[email-masked]>
> * On the subject of "Re: [clisp-list] read-char-no-hang broken?"
> * Sent on Tue, 1 Jul 2003 18:00:25 -0400
> * Honorable Douglas Philips <[email-masked]> writes:
>

I cannot reproduce this on win32, either with mingw or with cygwin
builds, using cvs head.

could you please try cvs head?

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Cannot handle the fatal error due to a fatal error in the fatal error handler.

---

From: Sam Steingold <[email-masked]>
Date: Wed Jul 2 11:44:30 2003

> * On the subject of "read-char-no-hang broken?"

I cannot reproduce it with the current cvs head on 
FreeBSD 4.7-RELEASE-p3 i386
Linux 2.4.21-pre7-ac1 #1 SMP i686

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
There are 10 kinds of people: those who count in binary and those who do not.

---

From: Douglas Philips <[email-masked]>
Date: Sun Jul 6 08:33:06 2003

> Linux 2.4.21-pre7-ac1 #1 SMP i686

Sam,
	Was able to build cvs head on my RedHat 8 Linux box this AM. The clisp 
post build tests failed with FFI problems, but I don't care about that 
right now. I was able to verify your behaviour: IT WORKS!!! On to 
Jaguar!
	BTW: Is there a time frame for the next official release (2.31?) If it 
was mentioned on the list, I guess I missed it. Not a biggie, just 
curious.
	Thanks!
		<D\'gou