[Openmcl-devel] Two streams questions

Gary Byers gb at clozure.com
Fri Jul 29 17:24:46 PDT 2016


See "ccl:library;serial-streams.lisp";  streams created via 
MAKE-SERIAL-STREAM as defined in that file are bivalent and 
INTERACTIVE-STREAM-P should be true of them.



On 07/29/2016 05:43 PM, Ron Garret wrote:
>
> On Jul 29, 2016, at 3:42 PM, Gary Byers <gb at clozure.com> wrote:
>
>> I have not tried this, looked at the code, or thought about this much,
>>
>> Does
>>
>> (defun read-byte-no-hang (s)
>>  (when (listen s)
>>    (read-byte s)))
>>
>> work ?
>
> Unfortunately, no.  CLHS specifically says:
>
> "On a non-interactive input-stream, listen returns true except when at end of file[1]”
>
> (IMHO this is a bug in the spec.)
>
>> Note also that a terminal device may be in one of a few "modes: (raw, cooked, cbreak) some of which may do line bufferimg (aka "rubout handling") inside the tty driver.
>
> Yes, this one is in raw mode.  I’ve been able to get this to work by using a character stream with a latin-1 encoding and read-char-no-hang, but that’s a horrible hack.
>
> rg
>



More information about the Openmcl-devel mailing list