Re: Metatables are "hard" (Re: Question about __index and classes)
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Metatables are "hard" (Re: Question about __index and classes)
- From: Daurnimator <quae@...>
- Date: 2011年9月12日 00:45:33 +1000
On 12 September 2011 00:26, Richter, Jörg <Joerg.Richter@pdv-fs.de> wrote:
>> In Lua you cannot sandbox a metatable away. An offending script still
>> might just call getmetatable.
>
> Then use __metatable:
>
> http://www.lua.org/manual/5.1/manual.html#pdf-getmetatable
>
> Jörg
>
>
As a note to using __metatable; its a good idea to return a
string/object unique to each metatable.
Its nice if code can use getmetatable() to check for type equality.
D