lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


t = {}
for j = 1, 2 do
   t[j] = function(x) return 2*x end
end
print(t[1] == t[2])

Lua 5.1    false
Lua 5.2    true
Lua 5.3    true
Lua 5.4    false

It seems that the equality between function values has returned back to its Lua 5.1 semantics.

1)
Why "function values caching" has been removed from Lua 5.4?

2)
Could we rely on the fact that in Lua 5.4+ any created function is unique value?