Re: detecting if a metatype already set

  • From: Mike Pall <mike-1305@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 26 May 2013 18:53:12 +0200

Justin Cormack wrote:
> Is there any way to see if a metatype has already been set on an ffi
> type? I can't seem to get pcall to catch this, or find another way to
> detect that its already been done.
> 
> Otherwise I will just make a module to stop it being redefined I guess.

Ordinarily, you'd set the metatype where you declare the ctype.
Both need to be done exactly once. A module solves just that.

--Mike

Other related posts: