lua-users home
lua-l archive

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


On 06/12/2015 02:29 PM, Soni L. wrote:


On 12/06/15 08:50 AM, Thomas Jericke wrote:
On 06/12/2015 01:51 PM, Soni L. wrote:
Don't forget name [[string]]

...and
(6.1) name.field
(6.2) name[arg]

Where name has a metatable and __new is a function.
__new? don't you mean __index?
--
Thomas


Yes, of course. Just to add more confusion, __index is just one of many metamethods you can abuse to implement call semantics. But IIRC only __call lets you return more than one return value.

Essentially, once you allow metamethods to be defined you can't recognize calls any more by looking at the code.
--
Thomas