more about build-index+cl-ppcre branch & encodings



On 3/2/11, Steve Haflich <smh at franz.com> wrote:
> Please read the ANS about file position.  There are good reasons it is
> defined the way it is.  If it were strictly defined to operate on
> character position rather than allowing monotonic octet position, it
> would be impossible to seek to a particular place on a
> variable-width-character stream without rereading the entire stream (or
> maintaining some complex binary tables).

I agree that it's useful for a file position to be just
a byte offset, but is that really required by the spec?
The glossary says only that file position increases monotonically
for character streams.

There is a remark in the description of FILE-POSITION,
"An integer  returned by file-position  of one argument should be
acceptable as position-spec for use with the same file."
which, if your exegesis-fu is strong enough, might imply that
file positions are byte offsets, since it seems to say that
a file position is a property of the file, not the stream,
therefore all streams have the same file positions ... I dunno.


FWIW

Robert Dodier