Skip to content

Commit b131fe9

Browse files
author
Jeremy Phelps
committed
[simple-bit-stream] Support WRITE-SEQUENCE to bit-streams that wrap
non-stream objects. This way, an object is wrappable if READ-BYTE and WRITE-BYTE methods are defined for it.
1 parent 4b03c4c commit b131fe9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

simple-bit-stream.lisp

+3-3
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ can be discarded if BYTE-ALIGNED-P returns T."))
190190
(unless (>= end start)
191191
(return-from %stream-write-sequence sequence))
192192
(cond ((and (equal (slot-value stream 'bits-left) 0)
193-
(slot-value stream 'real-stream))
193+
(streamp (slot-value stream 'real-stream)))
194194
(write-sequence sequence (slot-value stream 'real-stream) :start start :end end))
195195
(t (loop for ix from start to end
196196
do (write-byte (elt sequence ix) stream))
@@ -210,11 +210,11 @@ can be discarded if BYTE-ALIGNED-P returns T."))
210210
(return-from %stream-read-sequence sequence))
211211
(init-read stream)
212212
(cond ((and (equal (slot-value stream 'bits-left) 0)
213-
(slot-value stream 'real-stream))
213+
(streamp (slot-value stream 'real-stream)))
214214
(read-sequence sequence (slot-value stream 'real-stream) :start start :end end))
215215
(t
216216
(loop for ix from start below end
217-
do (setf (aref sequence ix) (read-byte stream))
217+
do (setf (elt sequence ix) (read-byte stream))
218218
count t))))
219219

220220
#-sbcl

0 commit comments

Comments
 (0)