On Fri, May 4, 2012 at 3:04 AM, Andrew Budd <email@example.com> wrote:If you don't want to call a function, this is the obvious way to go.
> Probably already obvious to most, but this is how I achieved the desired
> .prototype functionality
> at the bottom of the luaopen_array function
But you really do not need to do getglobal(). Note that you need to
return 1 in your luaopen_array() function, this means the array table
is on the stack top.
when require "array", the global variable 'array' will be assigned
after luaopen_array() returned (with the return value in stack top),
it seems that you cannot get the global value of array inside luaopen_