local url = "">
local a = url("mcp://host/thread/name")
local b = url("mcp://host/thread/name")
print(a == b)
--> true
collectgarbage()
print(a == b)
--> true
print(getmetatable(a).__eq == getmetatable(b).__eq)
--> true
local a = url("mcp://host/thread/name")
collectgarbage()
local b = url("mcp://host/thread/name")
print(a == b)
-->false
print(getmetatable(a).__eq == getmetatable(b).__eq)
--> false
```
In real code, the creation of two objects would happen at different times and so this would be more inconsistent .
Again, this quote from the reference manual...
> Closures with the same reference are always equal. Closures with any detectable difference (different behavior, different definition) are always different.
... allows for the current behavior. More precisely, it almost explicitly avoids addressing this scenario.
I respect the trade-offs, and this behavior for the `getequalhandler` inconsistent in a way that is hard to spot and hard to debug, even if the fix is simple, once found.
I've already re-factored my code, so I'll just have to watch out for this 'gotcha'.
Thank you for considering this.
-Andrew