Here we have the code from Lua Performance Tips:
local sin = math.sin function foo (x) for i = 1, 1000000 do x = x + sin(i) end return x end print(foo(10)) to which luajit reports:
stdin:3: attempt to call global 'sin' (a nil value) stack traceback: stdin:3: in function 'foo' stdin:1: in main chunk [C]: at 0x01000012d0 also: write the table to a local variable:
local a = {"abc", 123, true} then try to print her third key:
print (a[3]) to which the interpreter again informs me:
stdin:1: attempt to index global 'a' (a nil value) stack traceback: stdin:1: in main chunk [C]: at 0x01000012d0 What am I doing wrong? Tell me, pliz?