Go to the first, previous, next, last section, table of contents.


Class Stream

Class Stream is a bit of an exception to the general rule that built-in Muq classes exist only to implement secure multitasking: Class Stream is nowhere used in the fundamental Muq server functionality; It exists only to provide a simple and common service for muf programmers. (It seemed odd to me to provide the muf programmer with generic vectors and various specialized stacks and streams, but not to provide generic stacks and streams useful for arbitrary computation.)

Class Stream actually implements deques: Objects may be added or removed from either end, hence if may actually be used as a simple stack if desired. It seemed to me to promote clarity of programming to provide both stacks and the more general streams, however.

Class Stream adds the following properties to those of Class Plain:

$S.vector:   The vector used to actually hold the stream contents.
$S.length:   The current number of occupied slots in the stream.

Note: For convenience, the $S properties are also available in the public (default) propdir.

Since Class Stream is not part of the Muq security kernel, it does not attempt to protect Stream internals from malicious or nonsensical modification; The alert reader will have noticed that message-streams, by contrast, provide no direct access to the contents of the stream.

See section makeStream. See section push. See section pull. See section unpush. See section unpull. See section length. See section reset.


Go to the first, previous, next, last section, table of contents.