Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将 Lua 嵌入到我的应用程序中,但没有加载标准库。我检查了没有_G表,但我可以设置一些全局变量。这怎么可能?
_G
Lua 内部还有一个全局变量表。它只是作为变量不可见。
如果你加载package库,那么全局变量表可以在 Lua 中通过package.loaded._G.
package
package.loaded._G