[whatwg/encoding] Prepending or conversion of a sequence possibly not exact enough explained (#239)

In section 3 'Terminology' the idea of prepending a sequence of items to an I/O queue, or converting a list of items into an I/O queue is explained.  The described mechanisms work only, if the particular end-of-queue item is not present in the source.  Even if we accept for a moment, that an unreliable external source can never accidentally add an end-of-queue item to a sequence or a list, a sequence or a list may still contain this item.  This is because an I/O queue itself is a list, which in turn is an ordered sequence per definition.  So speaking of a sequence/list of items does not preclude the presence of an end-of-queue.
In
> To prepend a sequence of items, insert those items, in the given order, before the first item in the queue.

the possibly present end-of-queue item MUST NOT be inserted into a destination I/O queue, unless it is empty.
Similar for conversion.  IMO one should adapt the wording here to account for this exceptional situation.

Wolf Lammen

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/239

Received on Thursday, 22 October 2020 16:24:36 UTC