Changeset 462


Ignore:
Timestamp:
Feb 2, 2004, 8:08:41 AM (21 years ago)
Author:
Gary Byers
Message:

Bryan O'Connor's change to FILE-LENGTH.
Default methods on some things that are supposed to TYPE-ERROR, not
get a NO-APPLICABLE-METHOD.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-streams.lisp

    r441 r462  
    238238  (stream-write-string stream string))
    239239
     240
     241(defmethod stream-read-char ((x t))
     242  (report-bad-arg x 'stream))
     243
    240244(defmethod stream-read-char ((stream stream))
    241245  (error "~s is not capable of input" stream))
     246
     247(defmethod stream-unread-char ((x t) char)
     248  (declare (ignore char))
     249  (report-bad-arg x 'stream))
    242250
    243251(defmethod stream-unread-char ((stream stream) char)
     
    10421050
    10431051
     1052(defmethod stream-read-byte ((s t))
     1053  (report-bad-arg s '(and input-stream fundamental-binary-stream)))
     1054
     1055(defmethod stream-write-byte ((s t) b)
     1056  (declare (ignore b))
     1057  (report-bad-arg s '(and output-stream fundamental-binary-stream)))
     1058
    10441059(defmethod stream-length ((s stream) &optional new)
    10451060  (declare (ignore new)))
     
    22662281            (%incf-ptr buf written)))))))
    22672282
     2283(defmethod stream-read-line ((s buffered-stream-mixin))
     2284   (with-stream-ioblock-input (ioblock s :speedy t)
     2285     (%ioblock-read-line ioblock)))
     2286
    22682287(defmethod stream-clear-input ((s fd-input-stream))
    22692288  (call-next-method)
     
    23422361    ;; Don't use an OR type here
    23432362    (file-stream (stream-length stream))
    2344     (broadcast-stream (stream-length stream))))
     2363    (synonym-stream (file-length
     2364                     (symbol-value (synonym-stream-symbol stream))))
     2365    (broadcast-stream (let* ((last (last-broadcast-stream stream)))
     2366                        (if last
     2367                          (file-length last)
     2368                          0)))))
    23452369 
    23462370(defun file-position (stream &optional position)
Note: See TracChangeset for help on using the changeset viewer.