|
> for i=0,2 do
> local i_store = i
> local a = function() end;
> print(a);
> end
You need to use i inside the function to create different closures:
for i=0,2 do
local a = function() local _=i end
print(a)
end
But why do you need different functions that do the same thing?
(or should I say same nothing? :-)