Re: no custom metamethods for cdata

  • From: Mike Pall <mike-1402@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 28 Feb 2014 15:49:00 +0100

Evan Wies wrote:
> Similar to a recent post, I've been playing with metatables for
> cdata  I discovered that only standard metamethods may be used
> because `getmetatable` returns a string ('ffi') for cdata.

This is just an indication that the base metatable for cdata types
is 'off-limits' and must not be modified or inspected in any way.
It's quite common for Lua libraries to set __metatable to the
library name when they want to seal their metatables.

--Mike

Other related posts: