meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
lua:meta [2016/07/14 08:49] – [Metamethods] niziaklua:meta [2016/07/14 08:50] – [Metamethods] niziak
Line 48: Line 48:
  
 ===== Metamethods ===== ===== Metamethods =====
 +[[http://lua-users.org/wiki/MetatableEvents]]
 +
 +[[http://lua-users.org/wiki/MetamethodsTutorial]]  
 +
   * **%%__index%%** - is called when key in table is accessed. **%%__index%%** can be a function or another table - fallback table. Fallback table can have metatable which points to another fallback table and so on. It is possible to create very long fallback table chain.   * **%%__index%%** - is called when key in table is accessed. **%%__index%%** can be a function or another table - fallback table. Fallback table can have metatable which points to another fallback table and so on. It is possible to create very long fallback table chain.
     * **%%__index%% = function (table, key)**, return value of fucntion is returned as result.     * **%%__index%% = function (table, key)**, return value of fucntion is returned as result.