Handbook
Glossary
limited-stream
Limited input streams
Next:
limited-input ( limit -- )
Vocabulary
io
.
streams
.
limited
Inputs
None
Outputs
value
a limited-stream class
Word description
Limited streams wrap other streams, changing their behavior to throw an exception or return
f
upon exhaustion.
Definition
IN:
io.streams.limited
TUPLE:
limited-stream
stream count limit current start stop
;
Methods
USING:
accessors
destructors
io.streams.limited
;
M:
limited-stream
dispose
stream>>
dispose
;
USING:
accessors
io
io.streams.limited
;
M:
limited-stream
stream-element-type
stream>>
stream-element-type
;
USING:
accessors
io
io.streams.limited
kernel
math.order
;
M:
limited-stream
stream-length
dup
stream>>
stream-length
[
swap
limit>>
min
]
[
drop
f
]
if*
;
inline
USING:
io
io.streams.limited
io.streams.limited.private
;
M:
limited-stream
stream-read-partial-unsafe
[
stream-read-partial-unsafe
]
maybe-read-unsafe
;
USING:
io
io.streams.limited
io.streams.limited.private
;
M:
limited-stream
stream-read-unsafe
[
stream-read-unsafe
]
maybe-read-unsafe
;
USING:
io
io.streams.limited
io.streams.limited.private
kernel
sequences
;
M:
limited-stream
stream-read-until
swap
BV{
}
clone
(read-until)
[
2nip
B{
}
like
]
dip
;
USING:
io
io.streams.limited
io.streams.limited.private
kernel
;
M:
limited-stream
stream-read1
1
swap
[
nip
stream-read1
]
maybe-read
;
USING:
accessors
io
io.streams.limited
io.streams.limited.private
kernel
;
M:
limited-stream
stream-seek
>limited-seek
[
stream>>
stream-seek
]
[
limited-stream-seek
]
3bi
;
USING:
accessors
io
io.streams.limited
;
M:
limited-stream
stream-seekable?
stream>>
stream-seekable?
;
inline
USING:
accessors
io
io.streams.limited
;
M:
limited-stream
stream-tell
stream>>
stream-tell
;
USING:
accessors
io.streams.limited
;
M:
limited-stream
unlimit-stream
stream>>
;