lua-users home
lua-l archive

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


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