[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Multi-dimensional C arrays in Lua
- From: sessile@...
- Date: Thu, 22 Jan 2004 18:24:20 -0500
Hello,
Say I have the following type definition in C:
typedef double array2d[3][4];
I know I can create a new Lua type / userdata
and add "get" and "set" functions to access and
change the values from within a Lua script.
However, rather than have the script writer use
something like:
x = myarray.get(1,2)
I'm wondering if there is some elegant trickery
I'm not grasping at the moment that would allow
the access to be written as simply:
x = myarray[1][2]
Any clues?
Thanks,
Dean.
--
E-Mail: sessile@in-gen.net