Changeset 5673


Ignore:
Timestamp:
Jan 2, 2007, 8:57:19 AM (18 years ago)
Author:
Gary Byers
Message:

DOH! STREAM-READ-LINE method on BASIC-CHARACTER-INPUT-STREAM returns both values.

"Composite" (two-way, concatenated, etc) streams need a close protocol.

File:
1 edited

Legend:

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

    r5606 r5673  
    36873687  (let* ((ioblock (basic-stream-ioblock stream)))
    36883688    (with-ioblock-input-locked (ioblock)
    3689       (values
    3690        (funcall (ioblock-read-line-function ioblock) ioblock)))))
     3689      (funcall (ioblock-read-line-function ioblock) ioblock))))
    36913690
    36923691                             
     
    37493748  (make-instance 'synonym-stream :symbol (require-type symbol 'symbol)))
    37503749
     3750;;;
     3751(defclass composite-stream-mixin ()
     3752    ((open-p :initform t)))
     3753
     3754(defmethod close :after ((stream composite-stream-mixin) &key abort)
     3755  (declare (ignore abort))
     3756  (with-slots (open-p) stream
     3757    (setq open-p nil)))
     3758
     3759(defmethod open-stream-p ((stream composite-stream-mixin))
     3760  (slot-value stream 'open-p))
     3761
    37513762
    37523763
    37533764;;; Two-way streams.
    3754 (defclass two-way-stream (fundamental-input-stream fundamental-output-stream)
     3765(defclass two-way-stream (composite-stream-mixin fundamental-input-stream fundamental-output-stream)
    37553766    ((input-stream :initarg :input-stream :accessor two-way-stream-input-stream)
    37563767     (output-stream :initarg :output-stream :accessor two-way-stream-output-stream)))
     
    39103921;;;concatenated-streams
    39113922
    3912 (defclass concatenated-stream (fundamental-input-stream)
    3913     ((stream :initarg :streams :accessor concatenated-stream-streams)))
     3923(defclass concatenated-stream (composite-stream-mixin fundamental-input-stream)
     3924    ((streams :initarg :streams :accessor concatenated-stream-streams)))
     3925
    39143926
    39153927(defun concatenated-stream-current-input-stream (s)
Note: See TracChangeset for help on using the changeset viewer.