Files
luaj/src/test/res/autoload.lua
Ian Farmer e1d6ddf99c New autoload and math test cases. Currently autoload does not work because
the GETGLOBAL instruction does not handle the case where a metatable method
is invoked.
2007-07-21 04:44:22 +00:00

12 lines
251 B
Lua

local function autoload(table, key)
local chunk = loadfile("/"..key..".luac")
table[key] = chunk()
end
autoload_mt = { __index = autoload }
setmetatable(_G, autoload_mt)
print("square root of 9.0 is ", math.sqrt(9.0))
print("math.pi=", math.pi);