lua-users home
lua-l archive

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


I use SWIG to expose a few C++ classes to the user. In the C code, I use zero-based arrays (obviously), but in the Lua code that interfaces with the C code, I also have to use zero-based arrays. This seems somewhat unnatural for Lua programmers (right?). I admit I don't program in Lua too much.

Has anyone else had to deal with this issue? Was it a big deal for your users to have both zero/one based arrays in their Lua programs?

Is there a way to make SWIG convert all C++ vector uses to subtract one? Is that even wise? I'm guess I'm looking on thoughts on whether it is better to have all one based arrays with a Lua program, and if so, how do I do this easily with SWIG if it is even possible?

Thanks,
Joey

P.S. Thanks for the other help on the lua_isfunction and the stack count!