|
If I have this:
local t = {}
local another_function(wrapped, ...)
print(t[wrapper])
end
local function wrap(something_important)
local function wrapper(...)
return another_function(wrapper, ...)
end
t[wrapper] = something_important
return wrapper
end
Is it guaranteed that 2 calls to wrap() won't cause weird fucked-up semantics? E.g. can I do this?
local wrap1 = wrap(1)
local wrap2 = wrap(2)
wrap1() --> prints 1
wrap2() --> prints 2