lua-users home
lua-l archive

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


>
> a={}
>
> b={}
>
>
>
> a.a1=1
>
> b.b1=a
>
> -- add next line will fix it
>
> --a={}
>
> a.a1=2
>
> b.b2=a


Tables are handled by reference.  When you assign a to b.b1, it's not
copied.  This is your bug.  Try print(b.b1, b.b2)
wes