Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Lua:获取属于指定表的元素的环境_Lua - Fatal编程技术网

Lua:获取属于指定表的元素的环境

Lua:获取属于指定表的元素的环境,lua,Lua,是否可以检查某个对象是否确实是指定表的元素?我尝试使用debug.getfenv(o),但没有成功 someTable = {} someTable.someValue = "Some String" --gettable(someTable.someValue) --so that could return table that stores someValue: someTable getfenv之所以这样命名,是因为它返回函数的环境。因为只有函数才有环境 Lua中的值不知道它们在哪个表

是否可以检查某个对象是否确实是指定表的元素?我尝试使用
debug.getfenv(o)
,但没有成功

someTable = {}
someTable.someValue = "Some String"

--gettable(someTable.someValue)
--so that could return table that stores someValue: someTable

getfenv
之所以这样命名,是因为它返回函数的环境。因为只有函数才有环境


Lua中的值不知道它们在哪个表中。如果你需要知道这一点,你必须自己跟踪它。

你想解决什么问题?