Skip to content
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

Equality of structs/tuples is undefined #643

Open
tabatkins opened this issue Sep 18, 2024 · 2 comments
Open

Equality of structs/tuples is undefined #643

tabatkins opened this issue Sep 18, 2024 · 2 comments

Comments

@tabatkins
Copy link
Contributor

What is the issue with the Infra Standard?

It's not currently specified how struct/tuple equality works. This is required, for example, for it to be well-defined how they work as map keys (and this is already done, see https://html.spec.whatwg.org/multipage/webappapis.html#module-map).

I think the obvious answer (and definitely what's expected for the module map) is that struct/tuple equality is structural - two structs/tuples are equivalent if they have the same shape, and the contents are equal.

@domenic
Copy link
Member

domenic commented Sep 19, 2024

Related (but different): whatwg/html#10315

@annevk
Copy link
Member

annevk commented Sep 19, 2024

See also #230.

Defining this at the Infra level would require some kind of operator overloading and concepts that want to participate to consistently use "equals" to define their equality and such. I think it's something we have to do eventually, but it's quite a lift.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants