Changeset 6255


Ignore:
Timestamp:
Apr 11, 2007, 3:11:04 AM (18 years ago)
Author:
Gary Byers
Message:

Set IOBLOCK-ELEMENT-TYPE to CHARACTER for bivalent streams.

STREAM-ELEMENT-TYPE of BASIC-STREAM, BUFFERED-STREAM-MIXIN: don't maintain
the element-type separately, just look in ioblock. (STREAM-ELEMENT-TYPE
isn't required to work on closed streams.)

File:
1 edited

Legend:

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

    r6197 r6255  
    30833083      (setup-ioblock-output ioblock character-p element-type sharing encoding line-termination))
    30843084    (when element-type
    3085       (setf (ioblock-element-type ioblock) element-type))
     3085      (setf (ioblock-element-type ioblock) (if character-p 'character element-type)))
    30863086;    (when element-shift
    30873087;      (setf (ioblock-element-shift ioblock) element-shift))
     
    35373537    (gvector :basic-stream class 0 nil nil)))
    35383538
    3539 (defmethod initialize-basic-stream ((s basic-stream) &key element-type &allow-other-keys)
    3540   (setf (getf (basic-stream.info s) :element-type) element-type))
    3541 
     3539
     3540(defmethod initialize-basic-stream ((s basic-stream) &key &allow-other-keys)
     3541  )
     3542 
    35423543(defmethod initialize-basic-stream :after  ((s basic-input-stream) &key &allow-other-keys)
    35433544  (setf (basic-stream.flags s)
     
    45874588
    45884589(defclass buffered-stream-mixin ()
    4589   ((ioblock :reader %stream-ioblock :writer (setf stream-ioblock) :initform nil)
    4590    (element-type :initarg :element-type :reader %buffered-stream-element-type)))
     4590  ((ioblock :reader %stream-ioblock :writer (setf stream-ioblock) :initform nil)))
    45914591
    45924592(defmethod open-stream-p ((s buffered-stream-mixin))
     
    46124612 
    46134613(defmethod stream-element-type ((s buffered-stream-mixin))
    4614   (%buffered-stream-element-type s))
     4614  (ioblock-element-type (stream-ioblock s t)))
    46154615
    46164616(defmethod stream-element-type ((s basic-stream))
    4617   (getf (basic-stream.info s) :element-type))
     4617  (ioblock-element-type (basic-stream-ioblock s)))
    46184618
    46194619
Note: See TracChangeset for help on using the changeset viewer.