|
All this messing around with lightuserdata. The name itself... I don't know. Isn't that a standard use case for an embedded language to use things outside? Wouldn't it be better to offer one function that exposes the pointer inside the script and call it push_pointer() or some such understandable way? The three lines that do the trick in my example above say to me "I'm using that mechanism called lightuserdata although this is meant for something else."
Also, please let me add a tad criticism. When I look at the wiki page for language bindings ( http://lua-users.org/wiki/BindingCodeToLua ) I see no less than 22 projects and mechanisms that bind C++ for use inside Lua.
After filtering out the projects that are dead, unmaintained
or require an own library and therefore link dependency
Does the Lua community pursue any efforts in centralizing those projects
and perhaps boil them down for direct inclusion into the distribution? Or maybe recommend one?