On Wednesday, June 4, 2014, Andrew Starks <
andrew.starks@trms.com> wrote:
Sorry to answer my own post...
The manual says:
> Closures with the same reference are always equal. Closures with any detectable difference (different behavior, different definition) are always different.
I don't write specifications and I know that the reference manual isn't written that strictly, but we don't really have a complete definition. What is "detectable"? If a function doesn't access any upvalues and is the same function, is it always the same, or just sometimes? Is there a reason that two functions generated from the same constructor would point to the same reference when they are called from the same file, but will sometimes be and sometimes not be, when called from a different file?
I can't see where, or even how, busted is/could be broken. I see the inconsistent behavior when running the following code block, within a busted test:
local a = url("mcp://host/thread/name")
local b = url("mcp://host/thread/name/")
assert.True(a == b)
It seems like a bug in Lua or I'm not reading the correct parts of the Reference Manual.
-Andrew