[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How about removing the underscores from metatables?
- From: Javier Guerra Giraldez <javier@...>
- Date: Thu, 27 Jan 2011 15:18:28 -0500
On Thu, Jan 27, 2011 at 3:09 PM, Steve Litt <slitt@troubleshooters.com> wrote:
> Steve, you just lost me. I thought __index is the function that gets done when
> you write-access a key in the table. But A is the whole table, not a function.
> What am I missing?
__index can be a function or a table.
a common idiom is to use the same metatable as __index; so you put
there both the metamethods (__xxx) and OO-style methods
--
Javier