Frequently, I get an error from (read in)
, but it's difficult to see what goes wrong. I can try to use peek-...
on in
to help debugging, but that's also not convenient because I need to specify how many bytes I want to read, which is not always possible.
Has anyone created a solution to this problem?
Ideally, I want a function make-debug-input-port
. (make-debug-input-port in)
redirects every port operation to in
, but it emits debugging information on port operations. Has anyone done this before?
(I attempted to create it, but gave up after reading the make-input-port
doc. It's too dense for me to wrap my head around).