[racket] exception instead of EOF?

From: Dmitry Pavlov (dpavlov at ipa.nw.ru)
Date: Mon Dec 26 05:46:06 EST 2011

Hello,

I would like to make read-byte and friends to
throw an exception in case end of file is
reached. That is, when I call read-byte,
I know that the byte must be there, otherwise
the input data is corrupt. I would prefer
not to check the result of every read-byte
call. What is the simplest way to achieve
such a behavior?

Best regards,

Dmitry


Posted on the users mailing list.