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.
我正在研究一个 luarock 的火炬包。在测试期间,我想在 require "mypackage"不退出th会话的情况下获取最新代码。
require "mypackage"
th
但是,据我了解,require缓存加载的包,因此不会再次加载它们。Lua 手册似乎建议有一个全局变量来存储这个_LOADED缓存信息,我可以简单地将我的包的值设置为nil:
require
_LOADED
nil
_LOADED['mypackage'] = nil
然而,在火炬中,似乎没有一个_LOADED全球性的,即使在我需要一些包之后。
想法?