-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define an algorithm to create a Set from a List #659
Conversation
29f528e
to
875a5f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
infra.bs
Outdated
@@ -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. | |||
|
|||
<div algorithm> | |||
<p>To <dfn export for=set>create a set</dfn>, given a [=/list=] |input|: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'd prefer naming this either <dfn export>create a set from a list</dfn>
, or <dfn export for="set">create</dfn>
. The latter makes sense if we think there's no other reasonable input for creating a set, whereas the former is more specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went for <dfn export for="set">create</dfn>
. I think creating from other data structures is less common. Nevertheless, the create steps could accept a generic iterator instead of a list but since that is not currently specified it probably makes sense to just use the list.
644f5a4
to
7182a7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose we can always overload or chase down all callers using dontcallmedom's website in the worst case.
Thanks Alex! |
Thanks for reviewing! |
In the WebDriver BiDi spec, there is a need to convert lists created from JSON messages into sets for internal algorithms. This PR adds a helper to define how the operation of creating a set from a list should be performed. The operation seems to be common and relatively straight-forward so it might make sense that the Infra standard defines it.
Preview | Diff