[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: object addresses in Lua
- From: Geoff Leyland <geoff_leyland@...>
- Date: Tue, 31 May 2011 22:28:45 +1200
On 31/05/2011, at 10:16 PM, Joerg Walter wrote:
> This touches my question regarding table identifiers.
>
> As I understand it these pointers identify especially tables uniquely.
>
> So when I have
>
> g =
> {
> y = 1,
> z = 2
> }
>
> a =
> {
> b =
> {
> w = 200,
> x = 300,
> ref = g
> },
> v = 100
> }
>
> I get different pointers for a,b and g. The pointer for ref would hopefully yield the pointer for g?
$ lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> g = { y = 1, z = 2 }
> a = { b = { w = 200, x = 300, ref = g }, v = 100 }
> print(a, a.b, g, a.b.ref)
table: 0x100107270 table: 0x100107590 table: 0x100106a30 table: 0x100106a30
Do you not have a working Lua interpreter?
Cheers,
Geoff