A C++ program I'm working on is using lua for configuration. It sets up several lua functions using a hardcoded script:
luaL_loadbuffer(pmLuaState, headerscript, strlen(headerscript), "header script");
It then loads the configuration lua file (that calls the previously mentioned functions):
luaL_loadfile(pmLuaState, filename)
Unfortunately, the Lua configuration file uses a global variable named type, so attempting to call the built-in type() function from my headerscript fails with a Lua error:
attempt to call global 'type' (a string value)
Due to the constraints of my scenario, I am unable to edit the offending config file. I'm wondering if there's a way to explicity state that I want to use the built-in type() function.
I'm new to Lua, so if there's a better way to load in these scripts that will avoid this global hiding issue, I'm open to it (but again, I cannot edit the config script).
Lua version: 5.1.4