The return value of file-position of string-input-stream is wrong.
Bug #1884220 reported by
ryosuke sasaki
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Invalid
|
Undecided
|
Unassigned |
Bug Description
$ uname -a
Darwin usernoMacBook-
$ sbcl --version
SBCL 2.0.5
(let ((start 1))
(with-
(assert (eql start (file-position in)))))
Expect the return value of file-positioin to be start, but the actual value will be 0.
Changing this line to the following gave the correct result.
< (- (string-
< (string-
---
> (string-
description: | updated |
information type: | Private Security → Public |
To post a comment you must log in.
It's unclear that that's the right expected behavior.
Firstly, the subtraction is necessary because of displaced strings, but secondly, it's totally unclear what it would mean if you tried to assign the position to less than 5.
Consider that logically the :start and :end bound the arguments to SUBSEQ, and a valid implementation might be to actually call SUBSEQ and produce a string stream from that. So stream position 0 is string position 0, I can't any other thing that it should be.