[Openmcl-devel] Problem with read-sequence on binary streams

p2.edoc at googlemail.com p2.edoc at googlemail.com
Wed Jun 11 14:13:57 UTC 2008


I wondered if it should be (read-byte stream nil :eof)
but then there are plenty of other (read-byte stream) calls that seem 
to anticipate EOF conditions return :eof.

At 7:49 AM -0400 08/06/11, Bill St. Clair wrote:
>The difference, in case anyone, like me, didn't notice it at first
>blush, is changing "read-byte" to "stream-read-byte".
>
>-Bill
>
>On Tue, Jun 10, 2008 at 9:42 PM, Wade Humeniuk 
><wade.humeniuk at gmail.com> wrote:
>>  Through using Drakma I believe I have a found a bug for 
>>stream-read-vector for
>>  binary streams.  The problem thread can be found on the drakma-devel
>>  mailing list
>>
>>  http://common-lisp.net/pipermail/drakma-devel/2008-June/000314.html
>>
>>  The routine is in ./cct/level-1/l1-streams.lisp
>>
>>  the method
>>
>>  (defmethod stream-read-vector ((stream binary-input-stream)
>>                                vector start end)
>>   (declare (fixnum start end))
>>   (do* ((i start (1+ i)))
>>        ((= i end) end)
>>     (declare (fixnum i))
>  >    (let* ((b (read-byte stream)))
>>       (if (eq b :eof)
>>         (return i)
>>         (setf (uvref vector i) b)))))
>>
>>  probably should be changed to...
>>
>>  (defmethod stream-read-vector ((stream binary-input-stream)
>>                                vector start end)
>>   (declare (fixnum start end))
>>   (do* ((i start (1+ i)))
>>        ((= i end) end)
>>     (declare (fixnum i))
>>     (let* ((b (stream-read-byte stream)))
>>       (if (eq b :eof)
>>         (return i)
>  >        (setf (uvref vector i) b)))))



More information about the Openmcl-devel mailing list