file: job.t package: muf status: alpha
If the job has just read a value via
readStreamChar
or readStreamByte
, then
unreadStreamChar
may be used to effectively
undo the read.
There is no guarantee of being able to unread more than
one value deep, and the effect of calling
unreadStreamChar
in other contexts is
undefined. (In general, however,
unreadStreamChar
will do either the obvious
thing, or nothing.)
This function is also available under the names
unreadStreamByte
and unreadStreamValue
, to
improve code readability.
Example:
stack: makeMessageStream --> *s* stack: "abc\n" *s* writeStream stack: *s* readStreamByte stack: 97 #<root root> pop pop stack: *s* readStreamChar stack: 'b' #<root root> pop pop stack: *s* readStreamValue stack: 'c' "txt" #<root root> pop pop pop stack: *s* unreadStreamValue stack: *s* readStreamValue stack: 'c' "txt" #<root root>
See section unreadChar.
Go to the first, previous, next, last section, table of contents.