SEEK, the character I/O procedures, and my understanding don't fit
together. Apparently, READ- and PEEK-CHAR often ignore the I/O cursor,
which on its turn changes erratically after a SEEK with WHENCE =
seek/delta
or seek/end. In short: ???
(define (seekem readit)
(with-output-to-file "fumblatz.yup"
(lambda () (display 'abcdefg)))
(close-after (open-input-file "fumblatz.yup")
(lambda (inport)
(list (seek inport 1 seek/set)
(readit inport)
(seek inport 1 seek/delta)
(readit inport)
(seek inport 1 seek/set)
(readit inport) ))))
In scsh 0.6.4, Mac OS X 10.2.8
> (seekem read-char)
'(1 #\b 8 #\c 1 #\d)
> (seekem peek-char)
'(1 #\b 8 #\b 1 #\b)
rthappe
|