The problem of not being able to get a nested table just by calling
lua_getglobal(L, "someTable.interestingTable");
as you've written in
https://eliasdaler.wordpress.com/2015/09/08/using-lua-with-cpp-in-practice-part-2/I thought about iterating through name and checking for dots but I decided to not bother (and it'd break on names with dots in them like the module names) and instead push a piece of Lua code to stack and then call it so all type checking, ect. is done by Lua. That piece of code I've shown was to create a new library table and put it under name bla.native.draw into the package.loaded table so require can retrieve it, but you could get any nested table value out the same way:
luaL_loadstring(L, "return some.nested.table.value");
lua_pcall(L, 0, 1, 0)
{
//handle the errors, pop the error message, ect.
}
//some.nested.table.value is now on top of the stack
Lua 5.2.
Is there any special reason or feature that made you pick this over 5.1? I've used 5.2 for learning Lua because that's what was newest when I started but then went back to 5.1 so I could use LuaJIT if I wanted to and 5.3 issues made me think I made the right choice.