User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cl:types:broadcast-stream [2017/05/01 21:00] (current)
Line 1: Line 1:
 +====== System Class BROADCAST-STREAM ======
 +
 +====Class Precedence List====
 +**broadcast-stream**,​ **[[CL:​Types:​stream]]**,​ **[[CL:​Types:​t]]**
 +
 +====Description====
 +A //​[[CL:​Glossary:​broadcast stream]]// is an //​[[CL:​Glossary:​output]]//​ //​[[CL:​Glossary:​stream]]//​ which has associated with it a set of zero or more //​[[CL:​Glossary:​output]]//​ //​[[CL:​Glossary:​stream|streams]]//​ such that any output sent to the //​[[CL:​Glossary:​broadcast stream]]// gets passed on as output to each of the associated //​[[CL:​Glossary:​output]]//​ //​[[CL:​Glossary:​stream|streams]]//​. (If a //​[[CL:​Glossary:​broadcast stream]]// has no //​[[CL:​Glossary:​component streams]]//,​ then all output to the //​[[CL:​Glossary:​broadcast stream]]// is discarded.)
 +
 +The set of operations that may be performed on a //​[[CL:​Glossary:​broadcast stream]]// is the intersection of those for its associated //​[[CL:​Glossary:​output]]//​ //​[[CL:​Glossary:​stream|streams]]//​.
 +
 +Some output operations (//e.g.// **[[CL:​Functions:​fresh-line]]**) return //​[[CL:​Glossary:​values]]//​ based on the state of the //​[[CL:​Glossary:​stream]]//​ at the time of the operation.
 +
 +Since these //​[[CL:​Glossary:​values]]//​ might differ for each of the //​[[CL:​Glossary:​component streams]]//,​ it is necessary to describe their return value specifically:​
 +
 +  * **[[CL:​Functions:​stream-element-type]]** returns the value from the last component stream, or **[[CL:​Types:​t]]** if there are no component streams.
 +  * **[[CL:​Functions:​fresh-line]]** returns the value from the last component stream, or **[[CL:​Constant Variables:​nil]]** if there are no component streams.
 +  * The functions **[[CL:​Functions:​file-length]]**,​ **[[CL:​Functions:​file-position]]**,​ **[[CL:​Functions:​file-string-length]]**,​ and **[[CL:​Functions:​stream-external-format]]** return the value from the last component stream; if there are no component streams, **[[CL:​Functions:​file-length]]** and **[[CL:​Functions:​file-position]]** return ''​0'',​ **[[CL:​Functions:​file-string-length]]** returns ''​1'',​ and **[[CL:​Functions:​stream-external-format]]** returns **'':​default''​**.
 +  * The functions **[[CL:​Functions:​streamp]]** and **[[CL:​Functions:​output-stream-p]]** always return //​[[CL:​Glossary:​true]]//​ for //​[[CL:​Glossary:​broadcast streams]]//​.
 +  * The functions **[[CL:​Functions:​open-stream-p]]** tests whether the //​[[CL:​Glossary:​broadcast stream]]// is //​[[CL:​Glossary:​open]]//,​ not whether its component streams are //​[[CL:​Glossary:​open]]//​.
 +  * The functions **[[CL:​Functions:​input-stream-p]]** and //​[[CL:​Glossary:​interactive-stream-p]]//​ return an //​[[CL:​Glossary:​implementation-defined]]//,​ //​[[CL:​Glossary:​generalized boolean]]// value.
 +  * For the input operations **[[CL:​Functions:​clear-input]]** **[[CL:​Functions:​listen]]**,​ **[[CL:​Functions:​peek-char]]**,​ **[[CL:​Functions:​read-byte]]**,​ **[[CL:​Functions:​read-char-no-hang]]**,​ **[[CL:​Functions:​read-char]]**,​ **[[CL:​Functions:​read-line]]**,​ and **[[CL:​Functions:​unread-char]]**,​ the consequences are undefined if the indicated operation is performed. However, an //​[[CL:​Glossary:​implementation]]//​ is permitted to define such a behavior as an //​[[CL:​Glossary:​implementation-dependent]]//​ extension.
 +
 +For any output operations not having their return values explicitly specified above or elsewhere in this document, it is defined that the //​[[CL:​Glossary:​values]]//​ returned by such an operation are the //​[[CL:​Glossary:​values]]//​ resulting from performing the operation on the last of its //​[[CL:​Glossary:​component streams]]//;​ the //​[[CL:​Glossary:​values]]//​ resulting from performing the operation on all preceding //​[[CL:​Glossary:​stream|streams]]//​ are discarded. If there are no //​[[CL:​Glossary:​component streams]]//,​ the value is //​[[CL:​Glossary:​implementation-dependent]]//​.
 +
 +====See Also====
 +  * **[[CL:​Functions:​broadcast-stream-streams|Function BROADCAST-STREAM-STREAMS]]**
 +  * **[[CL:​Functions:​make-broadcast-stream|Function MAKE-BROADCAST-STREAM]]**
 +
 +\issue{TYPE-OF-AND-PREDEFINED-CLASSES:​UNIFY-AND-EXTEND} \issue{STREAM-ACCESS:​ADD-TYPES-ACCESSORS} \issue{BROADCAST-STREAM-RETURN-VALUES:​CLARIFY-MINIMALLY}