[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: table.new in 5.3?
- From: Steven Johnson <steve@...>
- Date: Wed, 20 Nov 2013 16:14:37 -0600
> 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().