|
match data with
| { name, x, y } -> return { sprite = '/img/'..name, x=x, y=y }
| { name} ->
local filename = '/img/'..name
local x, y = getDimensionsFromExternalTool(filename)
return { sprite = filename, x=x, y=y }
| _ -> error "invalid pattern"
end
if type(data)=='table' and #data="" then
local name, x, y = unpack(data);
return { sprite = '/img/'..name, x=x, y=y }
elseif type(data)=='table' and #data="" then
local name = unpack(data);
[...]
else error "invalid pattern" end
lua -l luarocks.loader -l metalua.loader -l my_lib code_using_my_lib.lua
luarocks make metalua-compiler-0.7.2-1.rockspec --local