lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I often see that people do miss the fact that __index and __newindex
> are called for non-existant keys only. When I was a newbie I missed
> that too.

To be correct, this is only the case for tables.
> 
> Maybe it is a good idea to emphasize this fact in the manual? Like add
> a short sentence to the blob of code that now describes the metamethod
> behaviour.

The pseudo code in the reference manual describes this very cleary, imo.

> I would even go further and add a full natural language description to
> each metamethod. While a blob of code is sufficient, it is too formal
> for newbie (who is not necessarily verse enough in Lua to get a full
> grasp of it).

A blob of code is what programmers should be able to read, imo.