Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Read-sequence and EOF?

27 views
Skip to first unread message

Shannon Spires

unread,
Dec 7, 1999, 3:00:00 AM12/7/99
to
What's the intent of ANSI wrt read-sequence and errors upon premature EOF of the input stream? The Hyperspec says:

If the end of file for stream is reached before
copying all elements of the subsequence, then the extra elements near the end   of sequence are not updated.

Position is the index of the first element of sequence that was not updated,   which might be less than end because the end of file was reached.

To me, this implies that read-sequence should never error simply because of a premature EOF. Instead, it should quietly return Position. Is this the correct interpretation?

Shannon Spires
svs...@telespin.com

Erik Naggum

unread,
Dec 8, 1999, 3:00:00 AM12/8/99
to
* Shannon Spires

| What's the intent of ANSI wrt read-sequence and errors upon premature EOF
| of the input stream?

READ-SEQUENCE has no exceptional conditions relating to end of file at
all, so it's unclear to me what the error could have been, whether the
EOF is premuture or expected.

#:Erik

Shannon Spires

unread,
Dec 8, 1999, 3:00:00 AM12/8/99
to

Precisely. I'm interpreting the lack of said exception to mean that the
committee intended for no exception to be there, rather than that they
simply forgot to include one. MCL currently throws an error on premature
EOF, and I suspect that's wrong. ACL does not, and my reading of ANSI says
that's the right thing. If anybody disagrees with this, please let me
know. Otherwise, I'm going to change MCL's behavior so it's consistent
with ACL.

Thanks,
Shannon Spires
svs...@telespin.com

0 new messages