M:: throws-on-eof-stream stream-read1 ( stream -- obj )
stream stream>> stream-read1
- [ 1 stream \ read1 stream-exhausted ] unless* ;
+ [ 1 stream \ read1 throw-stream-exhausted ] unless* ;
M:: throws-on-eof-stream stream-read-unsafe ( n buf stream -- count )
n buf stream stream>> stream-read-unsafe
- dup n = [ n stream \ stream-read-unsafe stream-exhausted ] unless ;
+ dup n = [ n stream \ stream-read-unsafe throw-stream-exhausted ] unless ;
M:: throws-on-eof-stream stream-read-partial-unsafe ( n buf stream -- count )
n buf stream stream>> stream-read-partial-unsafe
- [ n stream \ stream-read-partial-unsafe stream-exhausted ] when-zero ;
+ [ n stream \ stream-read-partial-unsafe throw-stream-exhausted ] when-zero ;
M: throws-on-eof-stream stream-tell
stream>> stream-tell ;
M: throws-on-eof-stream stream-read-until
[ stream>> stream-read-until ]
- [ '[ length _ \ read-until stream-exhausted ] unless* ] bi ;
+ [ '[ length _ \ read-until throw-stream-exhausted ] unless* ] bi ;
: stream-throw-on-eof ( ..a stream quot: ( ..a stream' -- ..b ) -- ..b )
[ <throws-on-eof-stream> ] dip with-input-stream* ; inline