[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Metatables and environments going wrong in Lua5.2
- From: Tom Cook <tom.k.cook@...>
- Date: Wed, 15 Apr 2015 16:04:40 +0930
Ah, I see. Thanks! That's fixed it.
On Wed, Apr 15, 2015 at 3:48 PM, 张睿 <zrui16@hotmail.com> wrote:
> m2.x = 2
>
> --this operation (settable) is raw, i.e. no metamethod is called and a new
> key “x” is created in m2, not m2.variables.
>
> If you want m2.variables.x to be changed, use a __newindex metamethod for m2
> (again, not m2.variables).