Re: I don't understand this application of metamethod
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: I don't understand this application of metamethod
- From: Dirk Laurie <dirk.laurie@...>
- Date: 2012年5月25日 09:10:44 +0200
2012年5月25日 Tim Mensch <tim-lua-l@bitgems.com>:
> The __index metamethod tells Lua what to do if someone tries to look up an
> undefined key on a table.
And (ex-Pythonistas please beware) it does NOT override the
normal table indexing method when the key is already present.