下面是我在SCIte中写的一些Lua代码,我完全不知道它有什么问题,所以有人可以向我解释我做错了什么以及如何解决它?你能告诉我这段代码有什么问题吗?
t = setmetatable({},{
__newindex = function(t, key)
if key == false then
return("False cannot exist in table")
key = nil
end
if key == __string then
table.concat[table, key]
else
table[key] = nil
end
if key == nil then
return "Tables in this file cannot contain false values."
end
}
)
function Error()
_,cError = pcall(__index)
end
function Call1()
error("error in metatable function, '__index'", 1)
end
function Call2()
Call1()
end
Error()
Call2()
在你知道什么样的方式,它的“错误”?它不是做你想做的事吗?你是否收到一条错误消息只是试图编译它? –
@DavidGelhar是的,它确实会导致错误消息。 – AugustusCeasar12