Re: Producing a value
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Producing a value
- From: uki <ukaszg@...>
- Date: 2011年4月20日 11:23:24 +0200
Metamethod (__newindex in this example) is only called when:
* 'a' is nil
* 'a' is a 'field' in a table (if its a global variable, it resides in _G - and thus you want to attach a metatable to _G - global enviroment)
http://pgl.yoyo.org/luai/i/lua_settable This one does.
2011年4月20日 Marc Balmer
<marc@msys.ch>
Does the Lua C part call a metatable method when it produces a value of
a variable?
i.e, if I have a userdata value 'n', can I intercept somehow the operation
a = n
? At the moment, this assigns the string 'n' to a.
--
Łukasz Gruner