diff --git a/infra.bs b/infra.bs index 01c621f..e41b011 100644 --- a/infra.bs +++ b/infra.bs @@ -1694,6 +1694,16 @@ unordered one, since interoperability requires that any developer-exposed enumer contents be consistent between browsers. In those cases where order is not important, we still use ordered sets; implementations can optimize based on the fact that the order is not observable. +
To create a [=/set=], given a [=/list=] |input|: + +
Let |result| be an empty [=/set=]. +
[=list/For each=] |item| of |input|, [=set/append=] |item| to |result|. +
Return |result|. +
To append to an ordered set: if the set contains the given item, then do nothing; otherwise, perform the normal list append operation.