(output-buffer-open? ob))))
(define (generic-io/write-self port output-port)
- (cond ((i/o-port? port)
- (write-string " for channels: " output-port)
- (write (generic-io/input-channel port) output-port)
- (write-string " " output-port)
- (write (generic-io/output-channel port) output-port))
- ((input-port? port)
- (write-string " for channel: " output-port)
- (write (generic-io/input-channel port) output-port))
- ((output-port? port)
- (write-string " for channel: " output-port)
- (write (generic-io/output-channel port) output-port))))
+ (let ((ib (port-input-buffer port))
+ (ob (port-output-buffer port)))
+ (let ((ic (and ib (input-buffer-channel ib)))
+ (oc (and ob (output-buffer-channel ob))))
+ (cond ((and ic oc (not (eq? ic oc)))
+ (write-string " for channels: " output-port)
+ (write ic output-port)
+ (write-string " " output-port)
+ (write oc output-port))
+ ((or ic oc)
+ (write-string " for channel: " output-port)
+ (write (or ic oc) output-port))))))
\f
(define (generic-io/supports-coding? port)
port