Open generic function
Tests whether a stream is at its end.
stream-at-end? stream => at-end?
<stream>.
<boolean>.
io
streams
Returns #t if the stream is at its end and #f if it is not. For input streams, it returns #t if a call to read-element with no supplied keyword arguments would signal an <end-of-stream-error>.
This function differs from stream-input-available?, which tests whether the stream can be read.
For output-only streams, this function always returns #f.
For output streams, note that you can determine if a stream is one place past the last written element by comparing stream-position to stream-size.
The following piece of code applies function to all the elements of a sequence:
let stream = make(<sequence-stream>, contents: seq); while (~stream-at-end?(stream)) function(read-element(stream)); end;