src/utilities.lisp (defvar-unbound): Make a variable with docs and no value.
[sod] / src / parser / streams-impl.lisp
index 6094b56..378f9a8 100644 (file)
@@ -7,7 +7,7 @@
 
 ;;;----- Licensing notice ---------------------------------------------------
 ;;;
 
 ;;;----- Licensing notice ---------------------------------------------------
 ;;;
-;;; This file is part of the Sensble Object Design, an object system for C.
+;;; This file is part of the Sensible Object Design, an object system for C.
 ;;;
 ;;; SOD is free software; you can redistribute it and/or modify
 ;;; it under the terms of the GNU General Public License as published by
 ;;;
 ;;; SOD is free software; you can redistribute it and/or modify
 ;;; it under the terms of the GNU General Public License as published by
     (clear-input ustream)))
 
 (defmethod stream-read-sequence
     (clear-input ustream)))
 
 (defmethod stream-read-sequence
-    ((stream proxy-input-stream) seq &optional (start 0) end)
+    ((stream proxy-input-stream) seq
+     #+clisp &key #-clisp &optional (start 0) end)
   (with-slots (ustream) stream
     (read-sequence seq ustream :start start :end end)))
 
   (with-slots (ustream) stream
     (read-sequence seq ustream :start start :end end)))
 
     (force-output ustream)))
 
 (defmethod stream-write-sequence
     (force-output ustream)))
 
 (defmethod stream-write-sequence
-    ((stream proxy-output-stream) seq &optional (start 0) end)
+    ((stream proxy-output-stream) seq
+     #+clisp &key #-clisp &optional (start 0) end)
   (with-slots (ustream) stream
     (write-sequence seq ustream :start start :end end)))
 
   (with-slots (ustream) stream
     (write-sequence seq ustream :start start :end end)))
 
          position-aware-stream-line position-aware-stream-column))
 (defclass position-aware-stream (proxy-stream)
   ((file :initarg :file :initform nil
          position-aware-stream-line position-aware-stream-column))
 (defclass position-aware-stream (proxy-stream)
   ((file :initarg :file :initform nil
-        :type pathname :accessor position-aware-stream-file)
+        :type (or pathname null) :accessor position-aware-stream-file)
    (line :initarg :line :initform 1
         :type fixnum :accessor position-aware-stream-line)
    (column :initarg :column :initform 0
    (line :initarg :line :initform 1
         :type fixnum :accessor position-aware-stream-line)
    (column :initarg :column :initform 0
    character increases the line number by one and resets the column number to
    zero; most characters advance the column number by one, but tab advances
    to the next multiple of eight.  (This is consistent with Emacs, at least.)
    character increases the line number by one and resets the column number to
    zero; most characters advance the column number by one, but tab advances
    to the next multiple of eight.  (This is consistent with Emacs, at least.)
-   The position can be read using STREAM-LINE-AND-COLUMN.
+   The position can be read using `stream-line-and-column'.
 
 
-   This is a base class; you probably want POSITION-AWARE-INPUT-STREAM or
-   POSITION-AWARE-OUTPUT-STREAM."))
+   This is a base class; you probably want `position-aware-input-stream' or
+   `position-aware-output-stream'."))
 
 (defgeneric stream-line-and-column (stream)
   (:documentation
 
 (defgeneric stream-line-and-column (stream)
   (:documentation
       (values line column))))
 
 (defmethod stream-pathname ((stream position-aware-stream))
       (values line column))))
 
 (defmethod stream-pathname ((stream position-aware-stream))
-  "Return the pathname corresponding to a POSITION-AWARE-STREAM.
+  "Return the pathname corresponding to a `position-aware-stream'.
 
 
-   A POSITION-AWARE-STREAM can be given an explicit pathname, which is
+   A `position-aware-stream' can be given an explicit pathname, which is
    returned in preference to the pathname of the underlying stream.  This is
    useful in two circumstances.  Firstly, the pathname associated with a file
    returned in preference to the pathname of the underlying stream.  This is
    useful in two circumstances.  Firstly, the pathname associated with a file
-   stream will have been subjected to TRUENAME, and may be less pleasant to
+   stream will have been subjected to `truename', and may be less pleasant to
    present back to a user.  Secondly, a name can be attached to a stream
    which doesn't actually have a file backing it."
 
    present back to a user.  Secondly, a name can be attached to a stream
    which doesn't actually have a file backing it."
 
 
    The position is actually cached in local variables, but will be written
    back to the stream even in the case of non-local control transfer from the
 
    The position is actually cached in local variables, but will be written
    back to the stream even in the case of non-local control transfer from the
-   BODY.  What won't work well is dynamically nesting WITH-POSITION forms."
+   BODY.  What won't work well is dynamically nesting `with-position' forms."
 
   (with-gensyms (line column char)
     (once-only (stream)
 
   (with-gensyms (line column char)
     (once-only (stream)
   (call-next-method))
 
 (defmethod stream-read-sequence
   (call-next-method))
 
 (defmethod stream-read-sequence
-    ((stream position-aware-input-stream) seq &optional (start 0) end)
+    ((stream position-aware-input-stream) seq
+     #+clisp &key #-clisp &optional (start 0) end)
   (declare (ignore end))
   (let ((pos (call-next-method)))
     (with-position (stream)
   (declare (ignore end))
   (let ((pos (call-next-method)))
     (with-position (stream)
    insertion of some user code."))
 
 (defmethod stream-write-sequence
    insertion of some user code."))
 
 (defmethod stream-write-sequence
-    ((stream position-aware-output-stream) seq &optional (start 0) end)
+    ((stream position-aware-output-stream) seq
+     #+clisp &key #-clisp &optional (start 0) end)
   (with-position (stream)
     (dosequence (ch seq :start start :end end)
       (update ch))
   (with-position (stream)
     (dosequence (ch seq :start start :end end)
       (update ch))