Discussing error conditions

This document uses two special terms in discussions of error conditions.

When we say that something is an error, we mean that the result is undefined. In particular, we do not mean that a Streams implementation must signal an error condition; that is the implementor's choice. So, for instance, the following text means only that the result of using unread-element in the case described is undefined:

It is an error to apply unread-element to an element that is not the element most recently read from the stream.

Only when we specifically mention signaling do we mean that a Streams implementation must signal an error condition. Note that we may not, in such a case, say exactly which error condition must be signaled; if we do not say so, the choice is again up to the implementor. In the following text, for instance, we state that an implementation must signal an error, but we do not say what error must be signaled:

When position is a <stream-position>, if it is invalid for some reason, this function signals an error.

By contrast, the following text says exactly which error must be signaled:

If the end of the stream is encountered and no value was supplied for on-end-of-stream, read-element signals an <end-of-stream-error> condition.