whatwg / infra

Infra Standard
https://infra.spec.whatwg.org/
Other
118 stars 94 forks source link

Equality of structs/tuples is undefined #643

Open tabatkins opened 2 days ago

tabatkins commented 2 days ago

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 commented 2 days ago

Related (but different): https://github.com/whatwg/html/issues/10315

annevk commented 2 days ago

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.