X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fgray-streams.lisp;h=2b0cc85d3e4aa9bff25871903757ca5cc239721b;hb=f3f677703e37f5a335b3be7fa64f7748ad969517;hp=fbf769a901144a10bb58af124cfddf0ae3fa34f4;hpb=414c64bc16680801257229b9b673f76a04b77cfd;p=sbcl.git diff --git a/src/pcl/gray-streams.lisp b/src/pcl/gray-streams.lisp index fbf769a..2b0cc85 100644 --- a/src/pcl/gray-streams.lisp +++ b/src/pcl/gray-streams.lisp @@ -99,7 +99,10 @@ (defmethod input-stream-p ((stream ansi-stream)) (ansi-stream-input-stream-p stream)) - + + (defmethod input-stream-p ((stream fundamental-stream)) + nil) + (defmethod input-stream-p ((stream fundamental-input-stream)) t) @@ -119,6 +122,9 @@ (defmethod output-stream-p ((stream ansi-stream)) (ansi-stream-output-stream-p stream)) + (defmethod output-stream-p ((stream fundamental-stream)) + nil) + (defmethod output-stream-p ((stream fundamental-output-stream)) t) @@ -492,12 +498,22 @@ "Used by READ-BYTE; returns either an integer, or the symbol :EOF if the stream is at end-of-file.")) +(defmethod stream-read-byte ((stream stream)) + (bug-or-error stream 'stream-read-byte)) +(defmethod stream-read-byte ((non-stream t)) + (error 'type-error :datum non-stream :expected-type 'stream)) + (defgeneric stream-write-byte (stream integer) #+sb-doc (:documentation "Implements WRITE-BYTE; writes the integer to the stream and returns the integer as the result.")) +(defmethod stream-write-byte ((stream stream) integer) + (bug-or-error stream 'stream-write-byte)) +(defmethod stream-write-byte ((non-stream t) integer) + (error 'type-error :datum non-stream :expected-type 'stream)) + ;; Provide a reasonable default for binary Gray streams. We might be ;; able to do better by specializing on the sequence type, but at ;; least the behaviour is reasonable. --tony 2003/05/08.