Name: Anonymous 2006-11-23 23:00
Is there a standard way to support unbuffered keyboard input in Common LISP, supported by all Common LISP interpreters?
So far I found something in the 'clisp' interpreter which comes with some nice unbuffered keyboard input macros. I wrote a readline function:
(defun readline ()
(ext:with-keyboard
(let ((rdlinstring ""))
(loop
(setq char (read-char ext:*keyboard-input*))
(setq key (or (ext:char-key char) (character char)))
(setq rdlinstring (concatenate 'string rdlinstring (string key)))
(write-string (string key))
(when (eql key #\Return)
(return rdlinstring))))))
But this doesn't work in CMUCL or SBCL. I think anything that exists in an ext: package in one interpreter isn't guaranteed to exist in an ext: package in another interpreter (since ext: isn't Common LISP standard, but implementation-specific extensions).
Ummm, so... is there a STANDARD way to get unbuffered keyboard input in Common LISP that's guaranteed to work properly across all implementations that are standards-compliant?
So far I found something in the 'clisp' interpreter which comes with some nice unbuffered keyboard input macros. I wrote a readline function:
(defun readline ()
(ext:with-keyboard
(let ((rdlinstring ""))
(loop
(setq char (read-char ext:*keyboard-input*))
(setq key (or (ext:char-key char) (character char)))
(setq rdlinstring (concatenate 'string rdlinstring (string key)))
(write-string (string key))
(when (eql key #\Return)
(return rdlinstring))))))
But this doesn't work in CMUCL or SBCL. I think anything that exists in an ext: package in one interpreter isn't guaranteed to exist in an ext: package in another interpreter (since ext: isn't Common LISP standard, but implementation-specific extensions).
Ummm, so... is there a STANDARD way to get unbuffered keyboard input in Common LISP that's guaranteed to work properly across all implementations that are standards-compliant?