lua-users home
lua-l archive

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


Hi,

Have anyone tried to determine, through a metatable, whether a given table key was called as a property or called as a method?

Something like:

t = setmetatable({}, my_mt)
print(t.a)   -- one behaviour
print(t.a()) -- another behaviour

I have tried some ways, but all I could muster was this:

my_mt = {

}


Luís Eduardo Jason Santos