假设以下 lua 代码:
local FooTable={ ["FooKey"]="FooValue" }
的索引"FooValue"是"FooKey"。所以我可以毫无问题地像这样访问它(假设 FooTable 在堆栈的顶部。):
lua_getfield(L, -1, "FooKey");
当我尝试这样的事情时:
local FooTable={ "FooValue" }
我会假设索引"FooValue"是"1"。但以下给了我一个nil回报。
lua_getfield(L, -1, "1");
是否有一种特殊的方法来访问表中的数字键?