-
Notifications
You must be signed in to change notification settings - Fork 98
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
List/contains definition unclear #230
Comments
See also #106. I think we mostly want object identity here, except for primitive data types. Most specifications already assume those semantics when it comes to equality. I think the second sentence doesn't really relate to the first that much and probably needs to be reworded. Maybe something like:
|
(I'd expect |
Can sets contain things like Records? I'm not sure if those are considered to have object identity. So the second sentence was just an independent definition of "exists"? I don't understand why that's necessary, given the definition of "exists" earlier in the section. |
|
|
No, I think it's meant as looping over the list, comparing the input item with the items that result from looping, and returning true if they're "equal". Anyway, I agree with you that this could use some refactoring. |
Some definitions in Infra are fairly vacuous. E.g. contains delegates to an undefined "appears in" concept, iterate to "on each item in order", append and prepend to "add". The intention is roughly "you already know what this vague concept is, but here's the exact word you can use and reference". We could probably redefine "contains" in terms of equals and iterate, instead of "appears". But I'm not sure how far we should pursue such a program. The endpoint of making these definitions rigorous is basically axiomatic set theory. |
From https://infra.spec.whatwg.org/#list-contain:
I'm confused about a couple points here:
(Context: I'm wondering about how to use an Infra set for the
[[PlatformBrand]]
(whatwg/webidl#97), and possibly also for private method brands (tc39/proposal-decorators#180). It looks like I'd use thiscontains
algorithm to check membership, right?)The text was updated successfully, but these errors were encountered: