From: Christophe Rhodes Date: Thu, 29 Jan 2004 15:17:26 +0000 (+0000) Subject: 0.8.7.31: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=34111868d4b78f1f96e010d1719b8efab732aaa7;p=sbcl.git 0.8.7.31: Make READ-BYTE and WRITE-BYTE signal errors on non-streams as required --- diff --git a/NEWS b/NEWS index aaca703..5402e4b 100644 --- a/NEWS +++ b/NEWS @@ -2288,6 +2288,8 @@ changes in sbcl-0.8.8 relative to sbcl-0.8.7: ** DIRECTORY on logical pathnames is more correct. ** CLEAR-INPUT, CLEAR-OUTPUT, FINISH-OUTPUT and FORCE-OUTPUT signal a TYPE-ERROR if their argument is not a stream. + ** READ-BYTE and WRITE-BYTE signal a TYPE-ERROR if their stream + designator argument does not designate a stream. planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/src/pcl/gray-streams.lisp b/src/pcl/gray-streams.lisp index fbf769a..a99099f 100644 --- a/src/pcl/gray-streams.lisp +++ b/src/pcl/gray-streams.lisp @@ -492,12 +492,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. diff --git a/version.lisp-expr b/version.lisp-expr index d6d2e29..2ef449c 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.7.30" +"0.8.7.31"