lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Matt Campbell wrote:
Hello Olver:

Your sample code looks nice, except for one fundamental problem. It assumes either a single, global Lua state, or something less portable such as thread-local storage (which I use in my current Windows-only project).

I would suggest adding "LuaInterpreter& L" as the first argument to registered functions, and changing the current global utility functions such as luaReturn to LuaInterpreter methods. This way, your C++ binding framework would support multiple Lua states in a portable way.

Yes, an important consideration, and there are ways to "keep it out of the way" but make it available if necessary (see next post). Thanks for the feedback.
Oliver