[string "blabla()"]:1: attempt to call global 'blabla' (a nil value)
note the automatic lifetime management
In the process of searching for a quick header-only wrapper for the Lua state I came across LuaState which was the first one that compiled out of the box. Its advantage over other wrappers for my needs was that it did reveal the actual Lua state, with the effect of other binding libraries being usable. It could itself provide an alternative to LuaBridge for writing bindings and could be investigated further.
It’s now easy to fork the project and try out bindings online.
Sometimes one needs to walk the Lua stack on the C++ side, for example, if passing tables to C++ via the new extended LuaBridge functionality. For that I’ve started luastackcrawler (see on github). The small test shows that it works at least in principle. A possible use case – configuration. If the layout of a stack entry, such as a table is known, one can write own wrappers around those to easily access the values. Right now one can iterate through stack and Lua table values, which can be of several types, represented by a boost::variant.