lua-users home
lua-l archive

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


Hi,

> 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]

I once implemented something ugly: myarray had a gettable metamethod
that returned a userdata pointing to the begining of a given row. This
temporary userdata had a different gettable method, that returned the
value at a given column.  Back in those days, all userdata were light,
and supported metamethods.  Not sure how bad this would be now that
userdata with metamethods are heavy.

[]s,
Diego.