[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Unique object references
- From: Chris <coderight@...>
- Date: Sat, 9 Dec 2006 08:06:16 -0500
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.
On 12/9/06, Luiz Henrique de Figueiredo <firstname.lastname@example.org> 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.