I'm a beginner in Lua.
I wonder if it is possible to use require('filename')
to require a script that is loaded using luaL_loadstring()
.
Since luaL_loadstring(lua_State *L, const char *s)
doesn't specify any filename, I don't know how to use require()
to load this script from other script.
Does require()
only works with actual .lua
files?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…