Hello Lua enthusiasts :)
I've been making quite light use of lua (from C/C++) on and off for a
couple of years now and I love it to bits :)
There are two things that I always wanted, but have never quite figured
out how to do. I'm sure they're probably quite easy. Here's the first;
I'll put the other in a separate mail.
Quite often I'll create a lua_State, and at the same time I'll create
some C structures or C++ objects. Something along the lines of:
lua_State * lua = luaL_newstate ();
MyThing * thing = new MyThing ();
Semantically, the C++ objects 'belong' to the lua_State. I have more
than one lua_State in my program, and I'd like each one to carry its
associated C++ structures around with it. However (and this is the
important bit) I don't want any scripts that the lua_State executes to
be able to access or modify the objects. The C++ objects should be
invisible to any lua scripts.