stream-external-format of two-way-stream is :default
Currently stream-element-type
of a two-way-stream
returns
:default
. This is true even if the input and output streams have
completely different external formats and neither uses
*default-external-format*
.
Consider this simple test:
;; Set up streams
(defvar *i* (lisp:make-fd-stream 100 :input t :external-format :iso8859-1))
*i*
(defvar *o* (lisp:make-fd-stream 101 :output t :external-format :utf-16))
*o*
(defvar *two* (make-two-way-stream *i* *o*))
*two*
;; Get the format
(stream-external-format *two*)
:default
(stream-external-format (two-way-stream-input-stream *two*))
:iso8859-1
(stream-external-format (two-way-stream-output-stream *two*))
:utf-16
Not sure what to do about this. Returning :default
isn't great
since in the test above *default-external-format*
is :utf-8
.
I suppose we could have stream-external-format
return a list of the
formats of the input and output streams.