Lookahead-* procedures mutate port position.
Issue #184
resolved
This should return (#\a 0 #\b)
but (#\a 1 #\a)
(define in (open-string-input-port "ab"))
(let* ((c0 (peek-char in))
(pos (port-position in))
(c1 (begin
(set-port-position! in 1)
(read-char in))))
(list c0 pos c1))
Comments (3)
-
reporter -
reporter - changed title to Lookahead-* procedures mutate port position.
-
reporter - changed status to resolved
Considering peeked buffer during returning port position (Fixes
#184)→ <<cset 9b05f1639723>>
- Log in to comment
It turned out that both binary and textual ports peeked port position handling is incorrect. The following script shows wrong results: