X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fpcl%2Fgray-streams.lisp;h=38eb79ea664821b26d8da5bd6c6d3f7669f80833;hb=d7cbe5c40e93796d326937f3fb962fa4d7b1fa85;hp=28ed0f172c3da9f7089ae5884048598c1ae71f36;hpb=8ef3aa533aba5ac5760e83b798cd6b2388a807a6;p=sbcl.git diff --git a/src/pcl/gray-streams.lisp b/src/pcl/gray-streams.lisp index 28ed0f1..38eb79e 100644 --- a/src/pcl/gray-streams.lisp +++ b/src/pcl/gray-streams.lisp @@ -88,7 +88,13 @@ (setf (stream-open-p stream) nil) t) -(setf (fdefinition 'close) #'pcl-close) +(progn + ;; KLUDGE: Get in a call to PCL-CLOSE with a string-output-stream before + ;; setting it as CLOSE. Otherwise using NAMED-LAMBDAs as DFUNs causes a + ;; vicious metacircle from FORMAT NIL somewhere in the compiler. This is + ;; enough to get the dispatch settled down before we need it. + (pcl-close (make-string-output-stream)) + (setf (fdefinition 'close) #'pcl-close)) (let () (fmakunbound 'input-stream-p) @@ -255,6 +261,7 @@ (error 'type-error :datum non-stream :expected-type 'stream)) (defgeneric stream-read-sequence (stream seq &optional start end) + #+sb-doc (:documentation "This is like CL:READ-SEQUENCE, but for Gray streams.")) @@ -465,6 +472,7 @@ T))) (defgeneric stream-write-sequence (stream seq &optional start end) + #+sb-doc (:documentation "This is like CL:WRITE-SEQUENCE, but for Gray streams.")) @@ -542,6 +550,18 @@ (basic-io-type-stream-write-sequence stream seq start end #'stream-write-byte)) +(defgeneric stream-file-position (stream &optional position-spec) + #+sb-doc + (:documentation + "Used by FILE-POSITION. Returns or changes the current position within STREAM.")) + +(defmethod stream-file-position ((stream ansi-stream) &optional position-spec) + (ansi-stream-file-position stream position-spec)) + +(defmethod stream-file-position ((stream t) &optional position-spec) + (declare (ignore stream position-spec)) + nil) + ;;; This is not in the Gray stream proposal, so it is left here ;;; as example code.