The C ++ program I'm working on uses lua for customization. It installs several lua functions using a hard-coded script:
luaL_loadbuffer(pmLuaState, headerscript, strlen(headerscript), "header script");
Then it loads the configuration lua file (which calls the previously mentioned functions):
luaL_loadfile(pmLuaState, filename)
Unfortunately, the Lua configuration file uses a global variable called type, so trying to call the built-in type () function from my header with the Lua error:
attempt to call global 'type' (a string value)
Due to the limitations of my script, I cannot edit the configuration file in violation. I am wondering if there is a way to explain that I want to use the built-in type () function.
Lua, , , , ( , script).
Lua: 5.1.4