lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: Metatables and environments going wrong in Lua5.2
From
: 张睿 <zrui16@
...
>
Date
: Wed, 15 Apr 2015 06:18:50 +0000
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).
Follow-Ups
:
Re: Metatables and environments going wrong in Lua5.2
,
Tom Cook
Prev by Date:
Metatables and environments going wrong in Lua5.2
Next by Date:
Re: Metatables and environments going wrong in Lua5.2
Previous by thread:
Metatables and environments going wrong in Lua5.2
Next by thread:
Re: Metatables and environments going wrong in Lua5.2
Index(es):
Date
Thread