Lua-API++  2015-02-12-3
Lua-API++ library
FAQ

Compatibility

Which versions of Lua does this library support?

Versions 5.1, 5.2 and 5.3.

Is this library compatible with LuaJIT?

Yes, all tests pass with LuaJIT in 5.1 compatibility mode.

Programming

Is it possible to use inherited classes with virtual functions as userdata?

Yes, just assign same string ID for base and derived classes. In methods cast self parameter to base class. Use base class methods for automatic wrapping.

Technical issues

I compiled the motivational example and it crashes on out-of-bound array access.

Using SJLJ mechanism for exceptions may create conflicts with Lua error reporting mechanism because it uses SJLJ too. It happens on chained exception-error-exception conversions (most probable point being State::call and State::run functions that encounter exception-raising error in Lua-API++ powered functions). How to avoid that problem:

  • use compiler with another exception mechanism (SJLJ isn't that good anyway);
  • make sure that pieces of Lua code executed with runString / runFile have simple error-free skeleton that protects calls to main code.