[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __methcall
- From: Daniel Silverstone <dsilvers@...>
- Date: Thu, 04 Nov 2004 18:21:15 +0000
On Thu, 2004-11-04 at 18:15 +0000, Daniel Silverstone wrote:
> Another alternative if you're worried is to do this:
[snip]
Or, as I remembered after I hit 'Send' -- play with the __metatable
property of metatables.
Lua 5.0.2 Copyright (C) 1994-2004 Tecgraf, PUC-Rio
> mt={__metatable="No, Go away"}
> t={}
> setmetatable(t,mt)
> =getmetatable(t)
No, Go away
> mt2={}
> setmetatable(t,mt2)
stdin:1: cannot change a protected metatable
stack traceback:
[C]: in function `setmetatable'
stdin:1: in main chunk
[C]: ?
>
D.
--
Daniel Silverstone http://www.digital-scurf.org/
PGP mail accepted and encouraged. Key Id: 2BC8 4016 2068 7895