[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: SWIG and 0/1 based arrays
- From: Joey Mukherjee <joey@...>
- Date: Tue, 5 Aug 2008 15:11:43 -0500
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!