gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] read-char-no-hang


From: James Amundson
Subject: [Gcl-devel] read-char-no-hang
Date: Sun, 06 Feb 2005 11:25:18 -0600

Hi,

As far as I can tell, the function read-char-no-hang always returns nil.
For example, try this function:

(defun foo ()
  (format t "normal: '~a'~%" (read-char))
  (format t "normal: '~a'~%" (read-char))
  (format t "no-hang: '~a'~%" (read-char-no-hang))
  (format t "normal: '~a'~%" (read-char))
  (read-line))

Execute (foo) and type 'abcd<return>'. With any other lisp, I get

* (foo)
abcd
normal: 'a'
normal: 'b'
no-hang: 'c'
normal: 'd'
""
NIL
*

With GCL 2.6.5 ANSI, I get

>(foo)
normal: '
'
abcd
normal: 'a'
no-hang: 'NIL'
normal: 'b'
"cd"
NIL

> 

Notice that the first read-char returns a spurious newline. I can live
with that. I don't know a way to check for available input without using
read-char-no-hang, however. Any suggestions?

--Jim

P.S. If this problem is fixed in GCL 2.6.6, I apologize. I didn't see
any relevant entries in the release notes.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]