lua-users home
lua-l archive

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


> While we are on the subject of API functions that would be nice to
> have directly from Lua:
>
> 1. getmetafield(tbl,key)  -- calls luaL_getmetafield.

Some time in the ancient past  I seconded this same suggestion. The
thinking being that a __metatable key meant you couldn't ask what
metamethods something implemented, whereas the intent was probably
just to make that thing tamper-proof. This was obviously simple to add
when I controlled the environment, but otherwise it's not quite
possible to make correct versions of is_callable() et al. without
recourse to debug.metatable().