READ on socket streams can block bogusly
Bug #667775 reported by
Nikodemus Siivola
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Triaged
|
Low
|
Unassigned |
Bug Description
If the stream has "(foo)" in it, without any following whitespace and the socket remains open, READ will block while trying to READ-CHAR ahead to see if there is any whitespace to discard.
It should probably use (when (listen stream) (read-char ...)) instead of plain read-char.
To post a comment you must log in.
In the case of having just read a closing paren, read probably shouldn't read anything more. If the next char turns out to be an open paren for the next list or some other character representing the beginning of a number or symbol, the reader will have to unread the char. Since a conditional check needs to be made one way or the other, why not check if a right paren closes the expression currently being read and, if so, be done with it? Since a closing paren delimits a list (whether or not whitespace follows), it strikes me that whitespace following the closing paren should not be consumed by read, even though it appears the spec would allow it.