lua-users home
lua-l archive

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

Thanks lua_topointer works also.  I didn't know about that one.  It
seems like there should be a topointer() in the script also although
it's trivial to add.

The advantage of tostring is that it makes it easy to override the
metamethod and return another value.  For instance on userdata types I
can return the pointer to the actual object rather than the userdata
pointer which makes referencing it outside of the VM easier.

Thanks again,

On 12/9/06, Luiz Henrique de Figueiredo <> wrote:
> Is there any way to get a state-wide unique reference to any
> particular object in the state?

The value itself is a good reference. Or you can try lua_topointer.