lua-users home
lua-l archive

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


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.

--
Matt Campbell
Lead Programmer
Serotek Corporation
www.freedombox.info
"The Accessibility Anywhere People"