Fix typos in docstrings and function names.
[sbcl.git] / src / pcl / gray-streams.lisp
index 28ed0f1..f182d4e 100644 (file)
   (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))
 \f
 (let ()
   (fmakunbound 'input-stream-p)
 (defgeneric stream-unread-char (stream character)
   #+sb-doc
   (:documentation
-   "Un-do the last call to STREAM-READ-CHAR, as in UNREAD-CHAR.
+   "Undo the last call to STREAM-READ-CHAR, as in UNREAD-CHAR.
   Return NIL. Every subclass of FUNDAMENTAL-CHARACTER-INPUT-STREAM
   must define a method for this function."))
 
   (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."))
 
   #+sb-doc
   (:documentation
    "Outputs a new line to the Stream if it is not positioned at the
-  begining of a line. Returns T if it output a new line, nil
+  beginning of a line. Returns T if it output a new line, nil
   otherwise. Used by FRESH-LINE. The default method uses
   STREAM-START-LINE-P and STREAM-TERPRI."))
 
       T)))
 
 (defgeneric stream-write-sequence (stream seq &optional start end)
+  #+sb-doc
   (:documentation
    "This is like CL:WRITE-SEQUENCE, but for Gray streams."))
 
   (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)
+
 \f
 ;;; This is not in the Gray stream proposal, so it is left here
 ;;; as example code.