|
Because older versions of Lua had more strict scopes.If you try to run this script in Lua 1.0 (Up to Lua 2.1) it will error:"$debug
local i = 123
repeat
local I = 321
print(i, I)
i = i + 1
until i > 1000"Output:"nil
123
lua: unexpected type at conversion to number
in statement begining at line 6 of file "benchmark.lua""Since I test Lua VM and not trying to squeeze the performance I decided to preserve it as global for the entire benchmark. Am I wrong with this statement?