[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __methcall
- From: Daniel Silverstone <dsilvers@...>
- Date: Fri, 05 Nov 2004 00:53:30 +0000
On Thu, 2004-11-04 at 10:26 -0800, Mark Hamburg wrote:
> > I think the easiest way to answer the questions regarding my patch is to
> > simply say..
> > __methcall first, then __index, then the table itself
> But what about entries in the table itself? Do those trump __methcall?
I said; completely clearly I think...
__methcall *first*
__index *second*
the table itself *last*
The patch itself makes this abundantly clear also
> > Personally I don't think it's a question of "hiding" or "making safe" --
> > I think it's far more a question partitioning the namespace a little
> Protected metatables make this work. If the metatable is protected then,
> __methcall only gets invoked from OP_SELF and hence the function can't leak
> into the general environment. This means that userdata then doesn't need to
> type-test the first parameter on method calls if it exposes it's methods via
> __methcall in a protected metatable.
Indeed. But this doesn't need to be only for userdata. it can provide
protected types in Lua itself too.
D.
--
Daniel Silverstone http://www.digital-scurf.org/
PGP mail accepted and encouraged. Key Id: 2BC8 4016 2068 7895