I'm writing a "C" userdata array structure. As setter and getter i want normal array access (u[0] = 1 u[0]) like it's discussed here: [c array share][1]Share Array between lua and C. For that i need to set __index and __newindex to the set and get functions in c.
Additional i want object-oriented access, too, "like u:mymethod()". My trouble is, that i need to set now __index to the metatable itself.
Is there a way, to achieve both?
__index
to be the metatable? It is easier if you keep them separate. – finnw