stream-element-type
stream-element-type stream → typespec
stream—a stream.
typespec—a type specifier.
21.3.0 6stream-element-type returns a type specifier that indicates the types of objects that may be read from or written to stream.
Streams created by open have an element type restricted to integer or a subtype of type character. KMP (2-Jan-91): How?? What would it mean? Does this have formal impact?
but in principle a \term{stream} may conduct transactions using any
\term{objects}.
Removed on instruction of Barrett, who concurred, saying:
I'm not convinced this is even true, since OPEN just says "acceptable",
which I read as saying undefined consequences, which permits an implementation
to extend to allow other kinds of objects. Even without that, the statement
isn't all that interesting, since OPEN only defined to deal with filestreams,
and an implementation could provide other kinds of streams which pass aribitrary objects.
;; Note that the stream must accomodate at least the specified type,
;; but might accomodate other types. Further note that even if it does
;; accomodate exactly the specified type, the type might be specified in
;; any of several ways.
(with-open-file (s "test" :element-type '(integer 0 1)
:if-exists :error
:direction :output)
(stream-element-type s))
→ INTEGER
OR→ (UNSIGNED-BYTE 16)
OR→ (UNSIGNED-BYTE 8)
OR→ BIT
OR→ (UNSIGNED-BYTE 1)
OR→ (INTEGER 0 1)
OR→ (INTEGER 0 (2))
None.
None.
Should signal an error of type type-error if stream is not a stream.
None.
None.